I want to install some RPM packages using Ansible and the installed rpm package manager. yum is not installed.
Using command
module with rpm -i {{package}}
causes the task to fail if the package is already installed. I'm searching for an idiomatic way to install the packages like yum or apt modules does it.
Install yum, plus yum-utils, and use the yum module. Not installed by default on AIX, but can be done.
Requirements include the yum and rpm Python modules. I'm unclear on which package provides the rpm bindings, something has to for yum to work. Possibly from the rpm fileset, but unfortunately I do not have an AIX box to test with.
Use
rpm -U
.From the manual:
I think this matches my problem the best so far:
item
is the path to a rpm file.The first task gets the MD5 checksum and the name of the package from the rpm file and compares the checksum with the installed package with the same package name. If the checksum doesn't match (and only then), the second task will install the rpm package.