Skip to content

Commit d84a297

Browse files
committed
fix: Force 'dnf' backend for older RHEL releases
Older RHEL OS use `yum` as package manager instead of `dnf`. Make sure to manually specify use_backend to tell the module whether to use the dnf4 or dnf5 backend.
1 parent 3b1ddd4 commit d84a297

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

roles/modules/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
- name: Install lua RedHat
1616
ansible.builtin.dnf:
17+
use_backend: "{{ (ansible_facts['distribution_major_version'] | int <= 7) | ternary('dnf', 'auto') }}"
1718
name:
1819
- lua
1920
- lua-json

roles/multipath/tasks/install-RedHat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
- name: Install multipath packages
33
ansible.builtin.dnf:
44
update_cache: true
5+
use_backend: "{{ (ansible_facts['distribution_major_version'] | int <= 7) | ternary('dnf', 'auto') }}"
56
name:
67
- device-mapper-multipath

0 commit comments

Comments
 (0)