diff --git a/playbooks/roles/prereqs/tasks/install_virtual_reqs.yml b/playbooks/roles/prereqs/tasks/install_virtual_reqs.yml index c4544322..c5055208 100644 --- a/playbooks/roles/prereqs/tasks/install_virtual_reqs.yml +++ b/playbooks/roles/prereqs/tasks/install_virtual_reqs.yml @@ -1,7 +1,12 @@ -- name: Install pre-requesites for dnf support for Fedora +- name: Install pre-requesites for dnf support for Fedora 29 and below raw: dnf install -y --allowerasing python-dnf - when: ansible_distribution == 'Fedora' + when: ansible_distribution == 'Fedora' and ansible_distribution_version|int <= 29 + become: true + +- name: Install pre-requesites for dnf support for Fedora 30 and above + raw: dnf install -y --allowerasing python3-dnf + when: ansible_distribution == 'Fedora' and ansible_distribution_version|int >= 30 become: true - name: Check if EPEL is installed for non Fedora distros @@ -38,4 +43,31 @@ - jq - libselinux-python - git - become: true \ No newline at end of file + become: true + when: not ansible_distribution == 'Fedora' + +- name: "Install libvirt, qemu-kvm, and jq on {{ ansible_distribution }} version 29 or below" + package: + name: "{{ item }}" + state: present + with_items: + - libvirt + - qemu-kvm + - jq + - libselinux-python + - git + become: true + when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int <= 29 + +- name: "Install libvirt, qemu-kvm, and jq on {{ ansible_distribution }} version 30 or above" + package: + name: "{{ item }}" + state: present + with_items: + - libvirt + - qemu-kvm + - jq + - python3-libselinux + - git + become: true + when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int >= 30