CentOS 8 does not always come with Python pre-installed, and so Ansible will fail running on the remote machine until it's been installed. However in a classic Chicken/Egg, you can't use the Ansible dnf
module to install Python.
I've been using:
- name: Install Python 3
raw: dnf -y install python3
However the problem with this is that I either have to set changed_when: false
or it will always return a changed state. I'd like the state reported properly if it's possible.
I found easy_install
however this appears to only deal with Python Libraries, and not Python itself. Is there a built-in way to handle this or is raw:
the only option?