I am trying to use ansible to use yum on a target RHEL 8.6 host. I have already compiled and built python 3.12 on the RHEL host and updated the symlink. I can use ‘python --version’ on the target RHEL host and can confirm the version returns as Python 3.12.8
Also, I have tried setting ansible_python_interpreter: /usr/bin/python in my source playbook, but it keeps returning with the same error no matter what:
TASK [Install latest kernel] ******************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SyntaxError: future feature annotations is not defined
fatal: [10.17.12.133]: FAILED! => {“changed”: false, “module_stderr”: “Shared connection to 10.17.12.133 closed.\r\n”, “module_stdout”: “Traceback (most recent call last):\r\n File "", line 12, in \r\n File "", line 971, in _find_and_load\r\n File "", line 951, in _find_and_load_unlocked\r\n File "", line 894, in _find_spec\r\n File "", line 1157, in find_spec\r\n File "", line 1131, in _get_spec\r\n File "", line 1112, in _legacy_get_spec\r\n File "", line 441, in spec_from_loader\r\n File "", line 544, in spec_from_file_location\r\n File "/tmp/ansible_ansible.legacy.dnf_payload_xzwufs6b/ansible_ansible.legacy.dnf_payload.zip/ansible/module_utils/basic.py", line 5\r\nSyntaxError: future feature annotations is not defined\r\n”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}