Trying install qemu-kvm-core and qemu-kvm-block-rbd at the same time was maddeningly throwing an error. Doing them individually works because one downgrades the other.
Signed-off-by: David Galloway <dgallowa@redhat.com>
tags:
- remove-ceph-dependency
+# We need the individual package manager ansible modules here because stuff like 'allow_downgrade' can't be passed via the package module.
- name: Install packages
- package:
+ yum:
+ name: "{{ packages|list }}"
+ state: present
+ allow_downgrade: yes
+ when:
+ - packages|length > 0
+ - (ansible_os_family == 'RedHat' and ansible_distribution_major_version|int <= 7)
+
+- name: Install packages
+ dnf:
name: "{{ packages|list }}"
- state: present
- when: packages|length > 0
+ state: present
+ allow_downgrade: yes
+ when:
+ - packages|length > 0
+ - (ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8)
- name: Install epel packages
package: