installation – Ansible Automation Platform – Installing “azure-cli” via yum is failing looking for python-dnf
I’m migrating a playbook from Ansible Tower to Ansible Automation Platform 4.3 that interacts with Azure DevOps. As such I need to install azure-cli for later commands, but it’s failing.
- name: Install the application package (RedHat)
# package:
yum:
name: "{{ azure_package_name }}"
state: present
Note I’ve tried package, then yum, but always get this error message:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not import the dnf python module using /usr/bin/python (3.9.13 (main, Nov 9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)]). Please install python3-dnf or python2-dnf package or ensure you have specified the correct ansible_python_interpreter. (attempted ['/usr/libexec/platform-python', '/usr/bin/python3', '/usr/bin/python2', '/usr/bin/python'])", "results": []}
I know AAP runs in Execution Environments now, I’m using the Automation Hub Default execution environment and talking to a RHEL system (the controller node itself.)
I don’t think I should have to manipulate the EE, so was thinking any dependency can be installed within the playbook itself. What am I doing wrong?
Tried switching “package” to “yum”, failed.
Tried installing azure-cli via yum directly to the server, this succeeded, but I still get the same failure message from the playbook.
I’m expecting it will be able to install azure-cli or detect it’s already installed.
Read more here: Source link
