openwisp / ansible-openwisp2

Ansible role that installs and upgrades OpenWISP.
https://openwisp.io/docs/dev/ansible/
BSD 3-Clause "New" or "Revised" License
474 stars 137 forks source link

Fix checking for Python version <3.7 #407

Closed emsu-io-suefke closed 1 year ago

emsu-io-suefke commented 1 year ago

Running $ ansible-playbook -i hosts playbook.yml -u user --check would always result in an error because the variable {{openwisp2_installed_python}} would never have been set when running with --check.

It is Ansible best practice to use Ansible native checks wherever possible and it is reasonable to assume that Ansible runs in the Python version the system has. For Python version checking, see https://serverfault.com/a/858684

Another change is to install >= Python 3.7 only if < Python 3.7 is found. The old expression looks as if it would install deadsnakes-python3.7 over system python3.7

Related to issue https://github.com/openwisp/ansible-openwisp2/issues/400

mikysal78 commented 1 year ago

When will the merge be done? As of today, if you don't have ubuntu, you can't upgrade or install!