File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 14
14
set_fact :
15
15
version : " -1.17.10-1.el{{ ansible_distribution_major_version }}.ngx"
16
16
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"
17
24
roles :
18
25
- role : ansible-role-nginx
19
26
vars :
Original file line number Diff line number Diff line change 10
10
set_fact :
11
11
repository : " {{ nginx_repository | default(default_repository) }}"
12
12
13
- - name : " (Install: CentOS/RedHat) Add NGINX Repository"
13
+ - name : " (Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 6/7 "
14
14
yum_repository :
15
15
name : nginx
16
16
baseurl : " {{ repository }}"
17
17
description : NGINX Repository
18
18
enabled : yes
19
19
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"
20
34
21
35
- name : " (Install: CentOS/RedHat) Install Required CentOS/RedHat Dependencies"
22
36
yum :
You can’t perform that action at this time.
0 commit comments