# Unable to use yum via Ansible on RHEL 8.6

**URL:** <https://forum.ansible.com/t/unable-to-use-yum-via-ansible-on-rhel-8-6/41160>\
**Category:** Get Help\
**Tags:** rhel\
**Created:** [March 20, 2025, 2:41pm UTC](https://forum.ansible.com/t/unable-to-use-yum-via-ansible-on-rhel-8-6/41160 "2025-03-20T14:41:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseto2](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mseto2](https://forum.ansible.com/u/mseto2)\
**Post date:** [March 20, 2025, 2:41pm UTC](https://forum.ansible.com/t/unable-to-use-yum-via-ansible-on-rhel-8-6/41160/1 "2025-03-20T14:41:55Z")

</div>

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}

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 20, 2025, 7:10pm UTC](https://forum.ansible.com/t/unable-to-use-yum-via-ansible-on-rhel-8-6/41160/2 "2025-03-20T19:10:48Z")

</div>

Dupe of [Unable to use yum on target RHEL 8.6 host that has python3.12](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/1)
