Ansible is using wrong version of Python
https://www.py4u.net/discuss/2713302Now when you run the playbooks from this directory, ansible will take the interpreter_python configuration and use python3.10; An important note that now if you run ansible-playbook --version it might still show you the older python version it was using. But when you execute the playbook, it will take the ansible.clf file into account.
Interpreter Discovery — Ansible Documentation
docs.ansible.com › interpreter_discoveryDec 21, 2021 · globally, use the interpreter_python key in the [defaults] section of ansible.cfg. Use one of the following values: auto_legacy : Detects the target OS platform, distribution, and version, then consults a table listing the correct Python interpreter and path for each platform/distribution/version. If an entry is found, and /usr/bin/python is absent, uses the discovered interpreter (and path). If an entry is found, and /usr/bin/python is present, uses /usr/bin/python and issues a warning.
Python 3 Support — Ansible Documentation
docs.ansible.com › python_3_supportUsing Python 3 on the managed machines with commands and playbooks Ansible will automatically detect and use Python 3 on many platforms that ship with it. To explicitly configure a Python 3 interpreter, set the ansible_python_interpreter inventory variable at a group or host level to the location of a Python 3 interpreter, such as /usr/bin/python3.
Ansible is using wrong version of Python - Stack Overflow
stackoverflow.com › questions › 61257164[defaults] stdout_callback = debug interpreter_python= /usr/local/bin/python3.10 Now when you run the playbooks from this directory, ansible will take the interpreter_python configuration and use python3.10; An important note that now if you run ansible-playbook --version it might still show you the older python version it was using. But when you execute the playbook, it will take the ansible.clf file into account.