Skip to content

Commit 4b0feeb

Browse files
committed
Update documentation and controller variables
1 parent ef1294b commit 4b0feeb

File tree

4 files changed

+124
-50
lines changed

4 files changed

+124
-50
lines changed

README.md

Lines changed: 93 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Use `ansible-galaxy install nginxinc.nginx` to install the role on your system.
1717

1818
It supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline) and [NGINX Plus](https://www.nginx.com/products/technical-specs/):
1919

20-
**NGINX Open Source:**
20+
**NGINX Open Source**
2121

2222
```yaml
2323
CentOS:
@@ -47,7 +47,7 @@ FreeBSD:
4747
- 11
4848
```
4949
50-
**NGINX Plus:**
50+
**NGINX Plus**
5151
5252
```yaml
5353
CentOS:
@@ -84,7 +84,52 @@ FreeBSD:
8484
- 11
8585
```
8686
87-
**NGINX Unit:**
87+
**NGINX Amplify**
88+
89+
```yaml
90+
CentOS:
91+
versions:
92+
- 6
93+
- 7
94+
RedHat:
95+
versions:
96+
- 6
97+
- 7
98+
Debian:
99+
versions:
100+
- jessie
101+
- stretch
102+
Ubuntu:
103+
versions:
104+
- trusty
105+
- xenial
106+
- artful
107+
- bionic
108+
Amazon Linux:
109+
versions:
110+
- 2017.09
111+
```
112+
113+
**NGINX Controller**
114+
115+
```yaml
116+
CentOS:
117+
versions:
118+
- 7
119+
RedHat:
120+
versions:
121+
- 7
122+
Debian:
123+
versions:
124+
- jessie
125+
- stretch
126+
Ubuntu:
127+
versions:
128+
- xenial
129+
- artful
130+
```
131+
132+
**NGINX Unit**
88133
89134
```yaml
90135
CentOS:
@@ -154,6 +199,16 @@ nginx_repository:
154199
# Default is mainline.
155200
branch: mainline
156201

202+
# Location of your NGINX Plus license in your local machine.
203+
# Default is the files folder within the NGINX Ansible role.
204+
license:
205+
certificate: license/nginx-repo.crt
206+
key: license/nginx-repo.key
207+
208+
# Delete NGINX Plus license after installation for security purposes.
209+
# Default is true.
210+
delete_license: true
211+
157212
# Install NGINX JavaScript, Perl, ModSecurity WAF (NGINX Plus only), GeoIP, Image-Filter, RTMP Media Streaming, and/or XSLT modules.
158213
# Default is false.
159214
modules:
@@ -171,27 +226,32 @@ modules:
171226
amplify_enable: false
172227
amplify_key: null
173228

229+
# Install NGINX Controller.
230+
# Use your NGINX Controller API key and NGINX Controller API endpoint.
231+
# Requires NGINX Plus.
232+
# Default is null.
233+
controller_enable: false
234+
controller_api_key: null
235+
controller_api_endpoint: null
236+
237+
# Install NGINX Unit and NGINX Unit modules.
238+
# Use a list of supported NGINX Unit modules.
239+
# Default is false.
240+
unit_enable: false
241+
unit_modules: null
242+
174243
# Enable NGINX status data.
175244
# Will enable 'stub_status' in NGINX Open Source and 'status' in NGINX Plus.
176245
# Default is false.
177246
status_enable: false
178247

179248
# Enable NGINX Plus REST API, write access to the REST API, and NGINX Plus dashboard.
249+
# Requires NGINX Plus.
180250
# Default is false.
181251
rest_api_enable: false
182252
rest_api_write: false
183253
rest_api_dashboard: false
184254

185-
# Location of your NGINX Plus license in your local machine.
186-
# Default is the files folder within the NGINX Ansible role.
187-
license:
188-
certificate: license/nginx-repo.crt
189-
key: license/nginx-repo.key
190-
191-
# Delete NGINX Plus license after installation for security purposes.
192-
# Default is true.
193-
delete_license: true
194-
195255
# Enable uploading NGINX configuration files to your system.
196256
# Default for uploading files is false.
197257
# Default location of files is the files folder within the NGINX Ansible role.
@@ -215,12 +275,6 @@ http_template_listen: 80
215275
http_template_server_name: localhost
216276
stream_template_enable: false
217277
stream_template_listen: 12345
218-
219-
# Install NGINX Unit and NGINX Unit modules.
220-
# Use a list of supported NGINX Unit modules.
221-
# Default is false.
222-
unit_enable: false
223-
unit_modules: null
224278
```
225279
226280
Dependencies
@@ -241,6 +295,16 @@ This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a
241295
- role: nginxinc.nginx
242296
```
243297
298+
This is a sample playbook file for deploying the Ansible Galaxy NGINX role to a dynamic inventory containing the `nginx` tag.
299+
300+
```yaml
301+
---
302+
- hosts: tag_nginx
303+
remote_user: root
304+
roles:
305+
- role: nginxinc.nginx
306+
```
307+
244308
This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a localhost and installing NGINX Plus.
245309

246310
```yaml
@@ -253,19 +317,23 @@ This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a
253317
type: plus
254318
```
255319

256-
This is a sample playbook file for deploying the Ansible Galaxy NGINX role to a dynamic inventory containing the `nginx` tag.
320+
This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a localhost to install NGINX Plus and the NGINX Controller agent.
257321

258-
```yml
259-
---
260-
- hosts: tag_nginx
261-
remote_user: root
322+
```yaml
323+
- hosts: localhost
324+
become: true
262325
roles:
263326
- role: nginxinc.nginx
327+
vars:
328+
type: plus
329+
controller_enable: true
330+
controller_api_key: <API_KEY_HERE>
331+
controller_api_endpoint: https://<FQDN>/1.4
264332
```
265333

266334
This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a localhost to install NGINX Unit and the PHP/Perl NGINX Unit language modules.
267335

268-
```yml
336+
```yaml
269337
---
270338
- hosts: localhost
271339
become: true

defaults/main.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ nginx_repository:
3232
# Default is mainline.
3333
branch: mainline
3434

35+
# Location of your NGINX Plus license in your local machine.
36+
# Default is the files folder within the NGINX Ansible role.
37+
license:
38+
certificate: license/nginx-repo.crt
39+
key: license/nginx-repo.key
40+
41+
# Delete NGINX Plus license after installation for security purposes.
42+
# Default is true.
43+
delete_license: true
44+
3545
# Install NGINX JavaScript, Perl, ModSecurity WAF (NGINX Plus only), GeoIP, Image-Filter, RTMP Media Streaming, and/or XSLT modules.
3646
# Default is false.
3747
modules:
@@ -50,33 +60,31 @@ amplify_enable: false
5060
amplify_key: null
5161

5262
# Install NGINX Controller.
53-
# Use your NGINX Controller API key.
63+
# Use your NGINX Controller API key and NGINX Controller API endpoint.
64+
# Requires NGINX Plus.
5465
# Default is null.
5566
controller_enable: false
56-
controller_license: null
57-
controller_api_url: null
67+
controller_api_key: null
68+
controller_api_endpoint: null
69+
70+
# Install NGINX Unit and NGINX Unit modules.
71+
# Use a list of supported NGINX Unit modules.
72+
# Default is false.
73+
unit_enable: false
74+
unit_modules: null
5875

5976
# Enable NGINX status data.
6077
# Will enable 'stub_status' in NGINX Open Source and 'status' in NGINX Plus.
6178
# Default is false.
6279
status_enable: false
6380

6481
# Enable NGINX Plus REST API, write access to the REST API, and NGINX Plus dashboard.
82+
# Requires NGINX Plus.
6583
# Default is false.
6684
rest_api_enable: false
6785
rest_api_write: false
6886
rest_api_dashboard: false
6987

70-
# Location of your NGINX Plus license in your local machine.
71-
# Default is the files folder within the NGINX Ansible role.
72-
license:
73-
certificate: license/nginx-repo.crt
74-
key: license/nginx-repo.key
75-
76-
# Delete NGINX Plus license after installation for security purposes.
77-
# Default is true.
78-
delete_license: true
79-
8088
# Enable uploading NGINX configuration files to your system.
8189
# Default for uploading files is false.
8290
# Default location of files is the files folder within the NGINX Ansible role.
@@ -100,9 +108,3 @@ http_template_listen: 80
100108
http_template_server_name: localhost
101109
stream_template_enable: false
102110
stream_template_listen: 12345
103-
104-
# Install NGINX Unit and NGINX Unit modules.
105-
# Use a list of supported NGINX Unit modules.
106-
# Default is false.
107-
unit_enable: false
108-
unit_modules: null

meta/main.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ galaxy_info:
3434

3535
galaxy_tags:
3636
- nginx
37-
- amplify
38-
- controller
37+
- nginx-oss
3938
- oss
39+
- nginx-plus
4040
- plus
41+
- nginx-amplify
42+
- amplify
43+
- nginx-controller
44+
- controller
45+
- nginx-unit
46+
- unit
4147
- web
4248
- server
43-
- unit
4449
- development
45-
- web
4650

4751
dependencies: []

tasks/controller/install-controller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
lineinfile:
2727
dest: /etc/controller-agent/agent.conf
2828
regexp: api_key =.*
29-
line: "api_key = {{ controller_license }}"
29+
line: "api_key = {{ controller_api_key }}"
3030

3131
- name: "(Setup: All OSs) Configure NGINX Controller Agent API URL"
3232
lineinfile:
3333
dest: /etc/controller-agent/agent.conf
3434
regexp: api_url =.*
35-
line: "api_url = {{ controller_api_url }}"
35+
line: "api_url = {{ controller_api_endpoint }}"
3636

3737
- name: "(Setup: All OSs) Configure NGINX Controller Agent API Hostname"
3838
lineinfile:

0 commit comments

Comments
 (0)