owntracks / quicksetup

A (mostly) automated installer for OwnTracks Recorder, Frontend with MQTT and Let's Encrypt
https://owntracks.org/booklet/guide/quicksetup/
15 stars 4 forks source link

Ubuntu has no ansible_distribution_minor_version #15

Closed jpmens closed 9 months ago

jpmens commented 9 months ago
ii  ansible                         2.10.7+merged+base+2.10.8+dfsg-1        all
$ ansible --version
ansible 2.10.8
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
        "ansible_distribution": "Ubuntu",
        "ansible_distribution_file_parsed": true,
        "ansible_distribution_file_path": "/etc/os-release",
        "ansible_distribution_file_variety": "Debian",
        "ansible_distribution_major_version": "22",
        "ansible_distribution_release": "jammy",
        "ansible_distribution_version": "22.04",
jpmens commented 9 months ago
TASK [verify some requirements] *****************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'ansible_version.full is version('2.4', '>=')' failed. The error was: 'bool' object has no attribute 'strip'"}
jpmens commented 9 months ago
TASK [verify some requirements] *****************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'ansible_distribution_release in [ 'bookworm' ]' failed. The error was: 'bool' object has no attribute 'strip'"}
jpmens commented 9 months ago
TASK [verify some requirements] *****************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check ''community.general.ufw' is community.general.a_module' failed. The error was: No test named 'community.general.a_module' found."}

giving up ...

jpmens commented 9 months ago

Now I get it:

TASK [system: create swapfile] ******************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'ansible_swaptotal_mb < 1' failed. The error was: 'bool' object has no attribute 'strip'\n\nThe error appears to be in '/root/quicksetup/owntracks-setup.yml': line 123, column 8, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n     - name: \"system: create swapfile\"\n       ^ here\nThis one looks easy to fix. It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote. For instance:\n\n    when: \"ok\" in result.stdout\n\nCould be written as:\n\n   when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n   when: \"'ok' in result.stdout\"\n"}

this is unchanged and has run on Ubuntu.

It's the jinja2_native = True that is hurting!

jpmens commented 9 months ago

I reverted yesterday's change of jinja2_native as it breaks far too much. Sadly the lovely MQTT welcome message from Ansible is now done in Python (booring!).