Source : https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
The managed node (the machine that Ansible is managing) does not require Ansible to be installed, but requires Python 2.7, or Python 3.5 - 3.11 to run Ansible-generated Python code
Source : https://access.redhat.com/articles/6977724
RHEL 6 utilizes Python 2.6, and with the release of Ansible Core 2.13, managed nodes running Python 2.6 are no longer supported
Question: RHEL 6 and RHEL 7 include newer versions of Python in the Software Collections repositories, can I install a newer version of Python so that newer versions of Ansible Core will still support these RHEL releases? This will not work, as the Python bindings for items such as yum are contained within the yum package, and the bindings are only included for the version of Python shipped with the respective RHEL release (Python 2.6 for RHEL 6, Python 2.7 for RHEL 7).
Question: I have RHEL 6 systems I need to manage with Ansible – what options do I have? Ansible Core 2.13, planned to be included with RHEL 8.7 and 9.1, is planned to remove support for RHEL 6 clients. For the RHEL System Roles use case, one option would be to use Ansible Engine 2.9 on a RHEL 7 or RHEL 8 control node. Ansible Engine 2.9, for the RHEL System Roles use case follows the life cycle dates of Ansible Automation Platform version 1.2 as specified on the Red Hat Ansible Automation Platform Life Cycle page.
Source : https://access.redhat.com/solutions/92933
Python 2.7 (and Python 3.3) is available through the Red Hat offering called Red Hat Software Collections (RHSCL).
Once the RHSCL repository is added to the system's repositories, then Python 2.7 can be installed with yum such as: Raw yum install python27-python
Source : https://docs.datastax.com/en/jdk-install/doc/jdk-install/installPython27RHEL.html
Not supported
Verify your Python version:
python -V
If Python is not version 2.7.x, install it from the Software Collections ( SCL ) Repository:
sudo yum update sudo yum install scl-utils sudo yum install centos-release-scl-rh sudo yum install python27 sudo scl enable python27 bash
Verify the update:
$ python -V Python 2.7.8
After logging out or restarting, you must enable python 2.7:
sudo scl enable python27 bash
Une autre façon est d’utiliser un Exécution Environment avec un Ansible Engine en 2.9.
Par exemple : « Automation Hub Ansible Engine 2.9 execution environment », parce que Ansible 2.9 support RH6.
Avec cette approche il n’est pas nécessaire de modifier les cibles. Par contre il sera probablement nécessaire de faire évoluer l’Execution Envionment.