I mainly used Debian because I’m way more familiar with it than with anything similar to RHEL. Do you have a new enough Python (3.9+) installed on your RHEL 8? If not, it won’t work anyway, thanks to how ansible-core works internally with Python modules, but it should be able to respawn with Python 3.6 with that module (as opposed to ansible-core’s dnf module, which won’t work with anything before Python 3.9).
Yes, this particular host is my RHEL8 Ansible Engine controller in my lab environment. It runs Ansible 2.16 itself and has Python 3.11 available for all other stuff.
But as I mentioned earlier, to me this is why EEs were invented
So is there any fix or workaround? Since upgrade to Ansible 2.17 all our Red Hat 8 based systems fail to deploy
Unfortunately, the workaround is to use Ansible-core 2.16.
Edit: And the problem isn’t just that Ansible itself doesn’t support python3.6 anymore, but that other python libraries that Ansible depends on no longer supports python3.6, including some required for the dnf module. Unlike other modules, we can’t just install a supported python on the remote RHEL8 hosts either, because the python-dnf library is only available through the platform-python (which is python3.6, and cannot be changed).
My currently preferred workaround:
- name: "install tools"
ansible.builtin.command: "dnf install -y nano telnet rsync wget htop tree"