hi
I am working on a project that requires a much older version of ansible and ansible core (ansible 4.8.0 and core 2.11.12)
I installed this in a virtual environment initially with a more recent version of ansible core 2.16.7 and the python interpreter is 3.10.12. Ansible was able to run the initial simple playbook. So the yml files are ok and the playbook can execute
However I need to run this on an older version of ansible 4.8.0 (core 2.11.12) because the project involves working with a lot of older legacy applications and older application versions and I want to minimize dependency issues. (The prototyping was done with 4.8.0 with these apps and it came up fine)
However when I downgrade ansible to 4.8.0 I see the following error message (in red) when running the playbook. Note the ansible downgrades fine. The python version is still the same 3.10.12.
My question is, is this the python interpreter incompatibility with the older 4.8.0 version?
The python is at 3.10.12. If so, how can I find out which version of python would be compatible with this older version of ansible?
Would manually adding the ansible_python_interpreter in ansible.cfg be a solution to this issue (once I find out the python version)?
I am now running pyenv virtualenv but the ansible downgrade is not working on these virtualenvs (the ansible version is using python3 and the virtualenv is only changing the python, not python3 version so it is not affecting it). If someone can help me with this I can start changing the python versions with pyenv to see which one will work with 4.8.0 (if this is indeed a python incompatibility issue)
the error message is below ( I am not certain it is due to the python incompatibility. It is a ModuleNotFound error)
(environment2) ubuntu@ip-172-31-21-52:~/course11_devops_startup/ansible$ ansible-playbook setup.yml
PLAY [main] ***********************************************************************************************************************
TASK [Gathering Facts] ************************************************************************************************************
fatal: [linode..com]: FAILED! => {âansible_factsâ: {}, âchangedâ: false, âfailed_modulesâ: {âansible.legacy.setupâ: {âansible_factsâ: {âdiscovered_interpreter_pythonâ: â/usr/bin/pythonâ}, âexceptionâ: âTraceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 100, in \r\n _ansiballz_main()\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 37, in invoke_module\r\n from ansible.module_utils import basic\r\n File "/tmp/ansible_ansible.legacy.setup_payload_zpd2pluy/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/basic.py", line 179, in \r\nModuleNotFoundError: No module named âansible.module_utils.six.movesâ\r\nâ, âfailedâ: true, âmodule_stderrâ: âShared connection to 173.230.155.238 closed.\r\nâ, âmodule_stdoutâ: âTraceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 100, in \r\n _ansiballz_main()\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/root/.ansible/tmp/ansible-tmp-1725583372.7010815-98005-169407147453131/AnsiballZ_setup.py", line 37, in invoke_module\r\n from ansible.module_utils import basic\r\n File "/tmp/ansible_ansible.legacy.setup_payload_zpd2pluy/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/basic.py", line 179, in \r\nModuleNotFoundError: No module named âansible.module_utils.six.movesâ\r\nâ, âmsgâ: âMODULE FAILURE\nSee stdout/stderr for the exact errorâ, ârcâ: 1, âwarningsâ: ["Platform linux on host linode..com is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change the meaning of that path. See Interpreter Discovery â Ansible Core Documentation for more information."]}}, âmsgâ: âThe following modules failed to execute: ansible.legacy.setup\nâ}
warm regards
Dave
=========