]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Allow downgrading packages during yum transactions wip-downgrade
authorDavid Galloway <dgallowa@redhat.com>
Thu, 30 Apr 2020 20:00:18 +0000 (16:00 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 30 Apr 2020 20:17:22 +0000 (16:17 -0400)
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>
roles/testnode/tasks/yum/packages.yml

index 010695ac427ed45faf464fa443d6ca1d5bafbb5b..634e0efd5d6fcf849fdf9f4c03e986459e6b7409 100644 (file)
   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: