When running ansible on a newly installed ubuntu 24.04 from an ansible server built with ubuntu 20.04, the following error occurs and it cannot be executed.
I think this is because the version of ansible provided for ubuntu20.04 is old, 2.9.6, and is not compatible with python3.12.
If you have ansible installed on ubuntu24.04, you can run it.
24.04 -> 20.04 OK
24.04 -> 24.04 OK
20.04 -> 22.04 OK
20.04 -> 24.04NG
The problem is that it is not possible to build a system from 22.04 to 24.04.
Code:
PLAY [Change Hosts] *****************************************************************************************************************************************************************
TASK [Gathering Facts] **************************************************************************************************************************************************************
fatal: [ubuntu-tar]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "exception": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 102, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 37, in invoke_module\r\n from ansible.module_utils import basic\r\n File \"/tmp/ansible_setup_payload_e17q1rns/ansible_setup_payload.zip/ansible/module_utils/basic.py\", line 171, in <module>\r\nModuleNotFoundError: No module named 'ansible.module_utils.six.moves'\r\n", "failed": true, "module_stderr": "Shared connection to 192.168.222.162 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 102, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1715506968.0486069-181617743508076/AnsiballZ_setup.py\", line 37, in invoke_module\r\n from ansible.module_utils import basic\r\n File \"/tmp/ansible_setup_payload_e17q1rns/ansible_setup_payload.zip/ansible/module_utils/basic.py\", line 171, in <module>\r\nModuleNotFoundError: No module named 'ansible.module_utils.six.moves'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: setup\n"}
PLAY RECAP **************************************************************************************************************************************************************************
ubuntu-tar : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Manually run the ansible script left locally.
Code:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1715503930.0680447-93623894992085/AnsiballZ_setup.py", line 247, in <module>
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1715503930.0680447-93623894992085/AnsiballZ_setup.py", line 237, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1715503930.0680447-93623894992085/AnsiballZ_setup.py", line 104, in invoke_module
from ansible.module_utils import basic
File "/tmp/ansible_setup_payload_umcg_j9w/ansible_setup_payload.zip/ansible/module_utils/basic.py", line 171, in <module>
ModuleNotFoundError: No module named 'ansible.module_utils.six.moves'
Bookmarks