Skip to content

Commit 0a60fe0

Browse files
committed
rocky version logic
1 parent 571db40 commit 0a60fe0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ansible/roles/fail2ban/tasks/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22
- name: Use dnf to set EPEL releasever during installation
33
ansible.builtin.command:
4-
cmd: "dnf install epel-release --setopt=releasever=9"
4+
cmd: >
5+
dnf install epel-release -y
6+
--setopt=releasever={{ ansible_distribution_major_version }}
7+
when: ansible_distribution_major_version in ["8", "9"]
58

69
- name: Install fail2ban packages
710
package:

ansible/roles/ofed/tasks/install.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
{{ _ofed_dnf_kernels.stdout_lines[1:] | map('split') | map(attribute=1) | map('regex_replace', '\.(?:.(?!\.))+$', '') | community.general.version_sort | last }}
2020
# dnf line format e.g. "kernel.x86_64 4.18.0-513.18.1.el8_9 @baseos "
2121

22-
- name: Enable epel
22+
- name: Use dnf to set EPEL releasever during installation
2323
ansible.builtin.command:
24-
cmd: "dnf install epel-release --setopt=releasever=9"
24+
cmd: >
25+
dnf install epel-release -y
26+
--setopt=releasever={{ ansible_distribution_major_version }}
27+
when: ansible_distribution_major_version in ["8", "9"]
2528

2629
- name: Check for existing OFED installation
2730
command: ofed_info

0 commit comments

Comments
 (0)