Description of problem:
With RHEL 8.6, and the ansible-core 2.12 included in RHEL, you cannot use ansible to manage localhost by using the hostname "localhost" in the playbook or inventory. That is, if you are running ansible on the same system that you want to manage, doing something like this will not work:
- hosts: localhost
The problem is that ansible-core 2.12 uses the python38 module, and many of the libraries that we use are missing such as blivet for the storage role, gobject for network, and many, many more.
You must instead tell ansible to use a local connection for localhost e.g. in the inventory use `ansible_connection=local`, or use `ansible-playbook -c local`, when you want to manage resources on localhost.
There is no way to fix this in the code, we will need to add this to our release notes and our documentation for RHEL8.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
how to quickly compare behavior with implicit localhost and explicit inventory connecting to localhost:
diff -u <(ansible -vvv -a /bin/true -c local localhost ) <(ansible -vvv -a /bin/true -c local -i 127.0.0.1, all )