Skip to content

Commit f3ec78e

Browse files
alessfggdzien
authored andcommitted
Add support to the role for RHEL 8 and Alpine Linux (#129)
* Add support to the role for RHEL 8 and Alpine Linux * Add NGINX Open Source support for Alpine Linux * Add NGINX Open Source support for SLES 15 * Update supported platforms matrix
1 parent df98f1a commit f3ec78e

13 files changed

+204
-128
lines changed

README.md

Lines changed: 60 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ It supports all platforms supported by [NGINX Open Source](https://nginx.org/en/
2020
**NGINX Open Source**
2121

2222
```yaml
23+
Alpine:
24+
versions:
25+
- 3.8
26+
- 3.9
2327
CentOS:
2428
versions:
2529
- 6
26-
- 7
30+
- 7.4+
2731
RedHat:
2832
versions:
2933
- 6
30-
- 7
34+
- 7.4+
35+
- 8
3136
Debian:
3237
versions:
3338
- jessie
@@ -36,62 +41,69 @@ Ubuntu:
3641
versions:
3742
- trusty
3843
- xenial
39-
- artful
4044
- bionic
4145
SUSE/SLES:
4246
versions:
4347
- 12
48+
- 15
4449
FreeBSD:
4550
versions:
46-
- 10
47-
- 11
51+
- 11.2+
52+
- 12
4853
```
4954
5055
**NGINX Plus**
5156
5257
```yaml
53-
CentOS:
58+
Alpine:
5459
versions:
55-
- 6
56-
- 7
57-
RedHat:
60+
- 3.8
61+
- 3.9
62+
Amazon Linux:
5863
versions:
59-
- 6
60-
- 7
64+
- 2018.03
65+
Amazon Linux 2:
66+
versions:
67+
- LTS
68+
CentOS:
69+
versions:
70+
- 6.5+
71+
- 7.4+
6172
Debian:
6273
versions:
6374
- jessie
6475
- stretch
65-
Ubuntu:
76+
FreeBSD:
6677
versions:
67-
- trusty
68-
- xenial
69-
- artful
70-
- bionic
78+
- 11.2+
79+
- 12
7180
Oracle Linux:
7281
versions:
73-
- 6.5
74-
- 7
75-
Amazon Linux:
76-
versions:
77-
- 2018.03
78-
SUSE/SLES:
82+
- 6.5+
83+
- 7.4+
84+
RedHat:
7985
versions:
80-
- 12
81-
FreeBSD:
86+
- 6.5+
87+
- 7.4+
88+
- 8
89+
SUSE/SLES:
90+
versions:
91+
- 12
92+
- 15
93+
Ubuntu:
8294
versions:
83-
- 10
84-
- 11
95+
- trusty
96+
- xenial
97+
- bionic
8598
```
8699
87100
**NGINX Amplify**
88101
89102
```yaml
90-
CentOS:
103+
Amazon Linux:
91104
versions:
92-
- 6
93-
- 7
94-
RedHat:
105+
- 2017.09
106+
CentOS:
95107
versions:
96108
- 6
97109
- 7
@@ -103,21 +115,25 @@ Ubuntu:
103115
versions:
104116
- trusty
105117
- xenial
106-
- artful
107-
- bionic
108-
Amazon Linux:
118+
- bionic
119+
RedHat:
109120
versions:
110-
- 2017.09
121+
- 6
122+
- 7
111123
```
112124
113125
**NGINX Controller**
114126
115127
```yaml
116-
CentOS:
128+
Amazon Linux:
117129
versions:
118-
- 7
119-
RedHat:
130+
- 2017.09
131+
Amazon Linux 2:
132+
versions:
133+
- LTS
134+
CentOS:
120135
versions:
136+
- 6
121137
- 7
122138
Debian:
123139
versions:
@@ -126,7 +142,11 @@ Debian:
126142
Ubuntu:
127143
versions:
128144
- xenial
129-
- artful
145+
- bionic
146+
RedHat:
147+
versions:
148+
- 6
149+
- 7
130150
```
131151
132152
**NGINX Unit**
@@ -147,11 +167,12 @@ Debian:
147167
Ubuntu:
148168
versions:
149169
- xenial
150-
- artful
151170
- bionic
152171
Amazon Linux:
153172
versions:
154173
- 2018.03
174+
Amazon Linux 2:
175+
versions:
155176
- 2
156177
FreeBSD:
157178
versions:

defaults/main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@ nginx_install_from: nginx_repository
2929
# Only works if 'install_from' is set to 'nginx_repository'.
3030
# Defaults are the official NGINX repositories.
3131
nginx_repository:
32+
alpine: >-
33+
https://nginx.org/packages/{{ (nginx_branch == 'mainline')
34+
| ternary('mainline/', '') }}alpine/v{{ ansible_distribution_version | regex_search('^[0-9]+\\.[0-9]+') }}/main
3235
debian:
3336
- >-
3437
deb https://nginx.org/packages/{{ (nginx_branch == 'mainline')
35-
| ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
38+
| ternary('mainline/', '') }}{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} nginx
3639
- >-
3740
deb-src https://nginx.org/packages/{{ (nginx_branch == 'mainline')
38-
| ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
39-
redhat:
40-
- >-
41+
| ternary('mainline/', '') }}{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} nginx
42+
redhat: >-
4143
https://nginx.org/packages/{{ (nginx_branch == 'mainline')
4244
| ternary('mainline/', '') }}{{ (ansible_distribution == "RedHat")
43-
| ternary('rhel/', 'centos/') }}{{ ansible_distribution_major_version|int }}/$basearch/
44-
suse:
45-
- >-
45+
| ternary('rhel', 'centos') }}/{{ ansible_distribution_major_version }}/$basearch/
46+
suse: >-
4647
https://nginx.org/packages/{{ (nginx_branch == 'mainline')
47-
| ternary('mainline/', '') }}sles/12
48+
| ternary('mainline/', '') }}sles/{{ ansible_distribution_major_version }}
4849
4950
# Specify which branch of NGINX Open Source you want to install.
5051
# Options are 'mainline' or 'stable'.

handlers/main.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
---
2-
- name: "(Handler: All OSs) Start NGINX"
3-
service:
4-
name: nginx
5-
state: started
6-
enabled: yes
7-
when: nginx_start
2+
- name: "(Handler: All OSs) Run NGINX"
3+
block:
84

9-
- name: "(Handler: All OSs) Reload NGINX"
10-
service:
11-
name: nginx
12-
state: reloaded
13-
when: nginx_start
5+
- name: "(Handler: All OSs) Start NGINX"
6+
service:
7+
name: nginx
8+
state: started
9+
enabled: yes
1410

15-
- name: "(Handler: All OSs) Start NGINX Amplify Agent"
16-
service:
17-
name: amplify-agent
18-
state: started
19-
when: nginx_start
11+
- name: "(Handler: All OSs) Reload NGINX"
12+
service:
13+
name: nginx
14+
state: reloaded
2015

21-
- name: "(Handler: All OSs) Start NGINX Controller Agent"
22-
service:
23-
name: controller-agent
24-
state: started
25-
when: nginx_start
16+
- name: "(Handler: All OSs) Start NGINX Amplify Agent"
17+
service:
18+
name: amplify-agent
19+
state: started
2620

27-
- name: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
28-
service:
29-
name: unit
30-
state: started
31-
enabled: yes
32-
when: nginx_start
21+
- name: "(Handler: All OSs) Start NGINX Controller Agent"
22+
service:
23+
name: controller-agent
24+
state: started
3325

34-
- name: "(Handler: FreeBSD) Start NGINX Unit"
35-
service:
36-
name: unitd
37-
state: started
38-
enabled: yes
39-
when: nginx_start
26+
- name: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
27+
service:
28+
name: unit
29+
state: started
30+
enabled: yes
31+
32+
- name: "(Handler: FreeBSD) Start NGINX Unit"
33+
service:
34+
name: unitd
35+
state: started
36+
enabled: yes
37+
38+
when: nginx_start | bool

meta/main.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,32 @@ galaxy_info:
1010
min_ansible_version: 2.4.0.0
1111

1212
platforms:
13-
- name: Debian
14-
versions:
15-
- jessie
16-
- stretch
17-
- name: Ubuntu
18-
versions:
19-
- trusty
20-
- xenial
21-
- artful
22-
- bionic
23-
- name: EL
24-
versions:
25-
- 6
26-
- 7
27-
- name: SLES
28-
versions:
29-
- 12
30-
- name: FreeBSD
31-
versions:
32-
- 10.4
33-
- 11.2
13+
- name: Alpine
14+
versions:
15+
- all
16+
- name: Amazon Linux
17+
- candidate
18+
- name: Debian
19+
versions:
20+
- jessie
21+
- stretch
22+
- name: EL
23+
versions:
24+
- 6
25+
- 7
26+
- name: FreeBSD
27+
versions:
28+
- 11.2
29+
- 12.0
30+
- name: Ubuntu
31+
versions:
32+
- trusty
33+
- xenial
34+
- bionic
35+
- name: SLES
36+
versions:
37+
- 12
38+
- 15
3439

3540
galaxy_tags:
3641
- nginx

tasks/keys/apk-key.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: "(Install: APK OSs) Download NGINX Signing Key"
3+
get_url:
4+
url: https://nginx.org/keys/nginx_signing.rsa.pub
5+
dest: /etc/apk/keys/nginx_signing.rsa.pub

tasks/main.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
or nginx_controller_enable
1919
or nginx_unit_enable
2020

21+
- import_tasks: keys/apk-key.yml
22+
when: ansible_os_family == "Alpine"
23+
2124
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
2225
block:
2326

@@ -28,7 +31,7 @@
2831
when: nginx_type == "plus"
2932

3033
- import_tasks: conf/cleanup-config.yml
31-
when: nginx_cleanup_config
34+
when: nginx_cleanup_config | bool
3235

3336
- import_tasks: modules/install-modules.yml
3437
when: true in nginx_modules.values()
@@ -47,26 +50,26 @@
4750
or nginx_rest_api_enable
4851

4952
- import_tasks: conf/setup-status.yml
50-
when: nginx_status_enable
53+
when: nginx_status_enable | bool
5154

5255
- import_tasks: conf/debug-output.yml
53-
when: nginx_debug_output
56+
when: nginx_debug_output | bool
5457

55-
when: nginx_enable
58+
when: nginx_enable | bool
5659

5760
- import_tasks: amplify/install-amplify.yml
5861
when:
59-
- nginx_amplify_enable
62+
- nginx_amplify_enable | bool
6063
- nginx_amplify_api_key is defined
6164
- nginx_amplify_api_key | length > 0
6265

6366
- import_tasks: controller/install-controller.yml
6467
when:
65-
- nginx_controller_enable
68+
- nginx_controller_enable | bool
6669
- nginx_controller_api_key is defined
67-
- nginx_controller_api_key
70+
- nginx_controller_api_key | length > 0
6871
- nginx_controller_api_endpoint is defined
69-
- nginx_controller_api_endpoint
72+
- nginx_controller_api_endpoint | length > 0
7073

7174
- import_tasks: unit/install-unit.yml
72-
when: nginx_unit_enable
75+
when: nginx_unit_enable | bool

0 commit comments

Comments
 (0)