I am running ansible core 2.11.12 on my Foreman server. Some times when I run my ansible roles against new Rocky Linux 8 hosts I get the following:
fatal: [host01.example.net]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "Shared connection to host01.example.net closed.",
"module_stdout": "/bin/sh: /usr/bin/python3: No such file or directory",
"msg": "The module failed to execute correctly, you probably need to set the interpreter.
See stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: ansible.legacy.setup"}
This only started happening after I created a new role to change the root password. Which is just using the Ansible USER module to set the password to a hash value.
All of our hosts are running Rocky Linux 8 which has python 3 by default. Our Foreman server is also running python 3. So I do not understand why its complaining about the interpreter.
I tried to add the ansible_interpreter in the ansible.conf but that ends up breaking all my roles. I tried adding just to the vars/main.yml of that role but that did not work.
If I pull that role out all the other roles run just fine. If I run that one role on its own on the same host it works fine. It only gives me an error when it am running it with a bunch of other roles.
1