As clearly mentioned above, rpm & its libraries are 32bit in AIX 7.1 and & AIX 7.2 , and hence the 32bit dnf. So the interpreter has to be 32bit which is "/opt/freeware/libexec/python3.9_32"
------------------------------
Ayappan P
------------------------------
Original Message:
Sent: Fri August 29, 2025 08:01 AM
From: Lionel Widmer
Subject: Ansible and DNF
hi,
Any update on this topic ?
Just tested on an AIX 7.2 LPAR with all RPMs up-to-date and we still have that issue on AIX 7.2. Changing python interpreter for that task to /opt/freeware/libexec/python3.9_32 is the only workaround we found for now
Thanks and best regards
Lionel
------------------------------
Lionel Widmer
Original Message:
Sent: Thu June 24, 2021 02:26 AM
From: SANKET RATHI
Subject: Ansible and DNF
Hi Andrey,
Yes dnf modules are 32bit right now hence it would be used with 32bit python.
The reason for that is rpm and its library are 32bit in AIX.
For future release of AIX we will look for 64bit solution but for AIX 7.1 and 7.2 this is going to be the case. Where ansible dnf module will have to use 32bit python3.
------------------------------
SANKET RATHI
Original Message:
Sent: Wed June 23, 2021 04:55 PM
From: Andrey Klyachkin
Subject: Ansible and DNF
looks like the cause for the error is the following line in ansible.cfg:
interpreter_python = /opt/freeware/bin/python3
If the line is changed to python3_32 (32 bit version of python3), everything works ok:
interpreter_python = /opt/freeware/bin/python3_32
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Wed June 23, 2021 04:50 PM
From: Andrey Klyachkin
Subject: Ansible and DNF
Trying to update packages using DNF module:
- name: update all RPM packages using dnf
dnf:
name: '*'
state: latest
Got the following error:
fatal: [server]: FAILED! => {"changed": false, "cmd": "dnf install -y python3-dnf", "msg": "Could not import the dnf python module using /opt/freeware/bin/python (3.7.10 (default, May 13 2021, 04:50:00) [GCC 8.3.0]). Please install `python3-dnf` package or ensure you have specified the correct ansible_python_interpreter.", "rc": 0, "results": [], "stderr": "", "stderr_lines": [], "stdout": "AIX generic repository 101 kB/s | 11 MB 01:55 \nAIX noarch repository 62 kB/s | 1.0 MB 00:16 \nAIX 7.2 specific repository 67 kB/s | 1.1 MB 00:16 \nLast metadata expiration check: 0:00:15 ago on Wed Jun 23 22:33:00 2021.\nPackage python3-dnf-4.2.17-1.noarch is already installed.\nDependencies resolved.\nNothing to do.\nComplete!\n", "stdout_lines": ["AIX generic repository 101 kB/s | 11 MB 01:55 ", "AIX noarch repository 62 kB/s | 1.0 MB 00:16 ", "AIX 7.2 specific repository 67 kB/s | 1.1 MB 00:16 ", "Last metadata expiration check: 0:00:15 ago on Wed Jun 23 22:33:00 2021.", "Package python3-dnf-4.2.17-1.noarch is already installed.", "Dependencies resolved.", "Nothing to do.", "Complete!"]}
Could not import the dnf python module using /opt/freeware/bin/python
python3-dnf is installed, that's why it says "Nothing to do":
# rpm -qa | grep 3-libdnf
python3-libdnf-0.39.1-1.ppc
------------------------------
Andrey Klyachkin
https://www.power-devops.com
------------------------------
#AIXOpenSource