File tree Expand file tree Collapse file tree 5 files changed +34
-53
lines changed Expand file tree Collapse file tree 5 files changed +34
-53
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,24 @@ This role has multiple variables. The defaults for all these variables are the f
84
84
# Default is 'opensource'.
85
85
type: opensource
86
86
87
- # Specify source respository for NGINX Open Source.
87
+ # Specify repository origin for NGINX Open Source.
88
88
# Options are 'nginx_repository' or 'os_repository'.
89
+ # Only works if 'type' is set to 'opensource'.
89
90
# Default is nginx_repository.
90
91
install_from: nginx_repository
91
92
93
+ # Specify source repository for NGINX Open Source.
94
+ # Only works if 'install_from' is set to 'nginx_repository'.
95
+ # Defaults are the official NGINX repositories.
96
+ nginx_repository:
97
+ debian:
98
+ - 'deb https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx'
99
+ - 'deb-src https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx'
100
+ redhat:
101
+ - https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ (ansible_distribution == "RedHat") | ternary('rhel/', 'centos/') }}{{ ansible_distribution_major_version|int }}/$basearch/
102
+ suse:
103
+ - https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}sles/12
104
+
92
105
# Specify which branch of NGINX Open Source you want to install.
93
106
# Options are 'mainline' or 'stable'.
94
107
# Only works if 'install_from' is set to 'nginx_repository'.
Original file line number Diff line number Diff line change 4
4
# Default is 'opensource'.
5
5
type : opensource
6
6
7
- # Specify source respository for NGINX Open Source.
7
+ # Specify repository origin for NGINX Open Source.
8
8
# Options are 'nginx_repository' or 'os_repository'.
9
+ # Only works if 'type' is set to 'opensource'.
9
10
# Default is nginx_repository.
10
11
install_from : nginx_repository
11
12
13
+ # Specify source repository for NGINX Open Source.
14
+ # Only works if 'install_from' is set to 'nginx_repository'.
15
+ # Defaults are the official NGINX repositories.
16
+ nginx_repository :
17
+ debian :
18
+ - ' deb https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx'
19
+ - ' deb-src https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx'
20
+ redhat :
21
+ - https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}{{ (ansible_distribution == "RedHat") | ternary('rhel/', 'centos/') }}{{ ansible_distribution_major_version|int }}/$basearch/
22
+ suse :
23
+ - https://nginx.org/packages/{{ "mainline/" if branch == "mainline" }}sles/12
24
+
12
25
# Specify which branch of NGINX Open Source you want to install.
13
26
# Options are 'mainline' or 'stable'.
14
27
# Only works if 'install_from' is set to 'nginx_repository'.
Original file line number Diff line number Diff line change 1
1
---
2
- - name : " (Install: Debian/Ubuntu) Add Mainline NGINX Repository"
2
+ - name : " (Install: Debian/Ubuntu) Add NGINX Repository"
3
3
apt_repository :
4
4
repo : " {{ item }}"
5
5
with_items :
6
- - deb https://nginx.org/packages/mainline/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
7
- - deb-src https://nginx.org/packages/mainline/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
8
- when : branch == "mainline"
9
-
10
- - name : " (Install: Debian/Ubuntu) Add Stable NGINX Repository"
11
- apt_repository :
12
- repo : " {{ item }}"
13
- with_items :
14
- - deb https://nginx.org/packages/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
15
- - deb-src https://nginx.org/packages/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
16
- when : branch == "stable"
6
+ - " {{ nginx_repository.debian }}"
Original file line number Diff line number Diff line change 1
1
---
2
- - name : " (Install: RedHat) Add Mainline NGINX Repository"
2
+ - name : " (Install: CentOS/ RedHat) Add NGINX Repository"
3
3
yum_repository :
4
4
name : nginx
5
- baseurl : https://nginx.org/packages/mainline/rhel/ {{ ansible_distribution_major_version|int }}/$basearch/
5
+ baseurl : " {{ nginx_repository.redhat }}"
6
6
description : NGINX Repository
7
7
enabled : yes
8
8
gpgcheck : yes
9
- when : branch == "mainline" and ansible_distribution == "RedHat"
10
-
11
- - name : " (Install: CentOS) Add Mainline NGINX Repository"
12
- yum_repository :
13
- name : nginx
14
- baseurl : https://nginx.org/packages/mainline/centos/{{ ansible_distribution_major_version|int }}/$basearch/
15
- description : NGINX Repository
16
- enabled : yes
17
- gpgcheck : yes
18
- when : branch == "mainline" and ansible_distribution == "CentOS"
19
-
20
- - name : " (Install: RedHat) Add Stable NGINX Repository"
21
- yum_repository :
22
- name : nginx
23
- baseurl : https://nginx.org/packages/rhel/{{ ansible_distribution_major_version|int }}/$basearch/
24
- description : NGINX Repository
25
- enabled : yes
26
- gpgcheck : yes
27
- when : branch == "stable" and ansible_distribution == "RedHat"
28
-
29
- - name : " (Install: CentOS) Add Stable NGINX Repository"
30
- yum_repository :
31
- name : nginx
32
- baseurl : https://nginx.org/packages/centos/{{ ansible_distribution_major_version|int }}/$basearch/
33
- description : NGINX Repository
34
- enabled : yes
35
- gpgcheck : yes
36
- when : branch == "stable" and ansible_distribution == "CentOS"
Original file line number Diff line number Diff line change 1
1
---
2
- - name : " (Install: SUSE) Add Mainline NGINX Repository"
2
+ - name : " (Install: SUSE) Add NGINX Repository"
3
3
zypper_repository :
4
4
name : nginx
5
- repo : https://nginx.org/packages/mainline/sles/12
6
- when : branch == "mainline"
7
-
8
- - name : " (Install: SUSE) Add Stable NGINX Repository"
9
- zypper_repository :
10
- name : nginx
11
- repo : https://nginx.org/packages/sles/12
12
- when : branch == "stable"
5
+ repo : " {{ nginx_repository.suse }}"
You can’t perform that action at this time.
0 commit comments