Skip to content

Commit 088a33b

Browse files
authored
Add CentOS/RedHat yum repository module_hotfixes option (#264)
1 parent f76441f commit 088a33b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

molecule/common/playbook_default.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
set_fact:
1515
version: "-1.17.10-1.el{{ ansible_distribution_major_version }}.ngx"
1616
when: ansible_os_family == "RedHat"
17+
- name: "Enable Nginx @CentOS-AppStream dnf modules"
18+
shell:
19+
args:
20+
cmd: dnf module info nginx | grep -q 'Stream.*\[e\]' && echo -n ENABLED || dnf module enable -y nginx # noqa 204 303
21+
register: dnf_module_enable
22+
changed_when: dnf_module_enable.stdout != 'ENABLED'
23+
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8"
1724
roles:
1825
- role: ansible-role-nginx
1926
vars:

tasks/opensource/setup-redhat.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,27 @@
1010
set_fact:
1111
repository: "{{ nginx_repository | default(default_repository) }}"
1212

13-
- name: "(Install: CentOS/RedHat) Add NGINX Repository"
13+
- name: "(Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 6/7"
1414
yum_repository:
1515
name: nginx
1616
baseurl: "{{ repository }}"
1717
description: NGINX Repository
1818
enabled: yes
1919
gpgcheck: yes
20+
when: ansible_distribution_major_version < "8"
21+
22+
- name: "(Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 8"
23+
blockinfile:
24+
path: /etc/yum.repos.d/nginx.repo
25+
create: true
26+
block: |
27+
[nginx]
28+
baseurl = {{ repository }}
29+
enabled = 1
30+
gpgcheck = 1
31+
name = NGINX Repository
32+
module_hotfixes = true
33+
when: ansible_distribution_major_version == "8"
2034

2135
- name: "(Install: CentOS/RedHat) Install Required CentOS/RedHat Dependencies"
2236
yum:

0 commit comments

Comments
 (0)