I am trying to install a bunch of RPMs that come from a tarball stored on a central server. These RPMs have dependencies on each other but that's not a problem when I install them manually, I just use:
# yum install *rpm
and they are all installed, yum works out that the dependencies are included in the other RPMs.
Using Ansible I transfer the tarball using the following play:
- name: Unpack installation bundle
unarchive:
src: /media/shared/archive/{{ sw }}-{{ os }}.tar.gz
dest: $HOME
This copies the tarball to the remote server and unpacks it. This works.
The problem is when I try and install the RPMs. I currently have the following plays:
- name: Finding RPM files
find:
paths: "$HOME/{{ sw }}"
patterns: "*.rpm"
register: rpm_result
- name: Install RPM
yum:
name: "{{ item.path }}"
state: present
with_items: "{{ rpm_result.files }}"
become: yes
become_method: sudo
The rpm_result.files is correctly populated with all of the RPMs but some of them are not installed because the yum module seems to be installing them individually even though the documentation claims that it does them together (see "Notes" in http://docs.ansible.com/ansible/latest/yum_module.html) When I run the playbook I get complaints about missing dependencies:
"Error: Package: snmpagent-1.2.0.0-1.el6.x86_64 (/snmpagent-1.2.0.0-1.el6.x86_64)
Requires: utils >= 3.1.0.0\n", "rc": 1,
(Output shortened and sliced up to make it easier to read)
This is the same error I get if I try and install the RPMs one at a time.
How do I persuade yum to install all RPMs at the same time?
I am running ansible-playbook v2.4.0.0, so it's reasonably recent.