@@ -170,6 +170,9 @@ This role has multiple variables. The defaults for all these variables are the f
170
170
# Default is true.
171
171
nginx_enable : true
172
172
173
+ # Print NGINX configuration file to terminal after executing playbook.
174
+ nginx_debug_output : false
175
+
173
176
# Specify which version of NGINX you want to install.
174
177
# Options are 'opensource' or 'plus'.
175
178
# Default is 'opensource'.
@@ -186,12 +189,12 @@ nginx_install_from: nginx_repository
186
189
# Defaults are the official NGINX repositories.
187
190
nginx_repository :
188
191
debian :
189
- - deb https://nginx.org/packages/{{ (branch == 'mainline') | ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
190
- - deb-src https://nginx.org/packages/{{ (branch == 'mainline') | ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
192
+ - deb https://nginx.org/packages/{{ (nginx_branch == 'mainline') | ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
193
+ - deb-src https://nginx.org/packages/{{ (nginx_branch == 'mainline') | ternary('mainline/', '') }}{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} nginx
191
194
redhat :
192
- - https://nginx.org/packages/{{ (branch == 'mainline') | ternary('mainline/', '') }}{{ (ansible_distribution == "RedHat") | ternary('rhel/', 'centos/') }}{{ ansible_distribution_major_version|int }}/$basearch/
195
+ - https://nginx.org/packages/{{ (nginx_branch == 'mainline') | ternary('mainline/', '') }}{{ (ansible_distribution == "RedHat") | ternary('rhel/', 'centos/') }}{{ ansible_distribution_major_version|int }}/$basearch/
193
196
suse :
194
- - https://nginx.org/packages/{{ (branch == 'mainline') | ternary('mainline/', '') }}sles/12
197
+ - https://nginx.org/packages/{{ (nginx_branch == 'mainline') | ternary('mainline/', '') }}sles/12
195
198
196
199
# Specify which branch of NGINX Open Source you want to install.
197
200
# Options are 'mainline' or 'stable'.
@@ -245,35 +248,110 @@ nginx_unit_modules: null
245
248
# Will enable 'stub_status' in NGINX Open Source and 'status' in NGINX Plus.
246
249
# Default is false.
247
250
nginx_status_enable : false
251
+ nginx_status_port : 8080
248
252
249
253
# Enable NGINX Plus REST API, write access to the REST API, and NGINX Plus dashboard.
250
254
# Requires NGINX Plus.
251
255
# Default is false.
252
256
nginx_rest_api_enable : false
257
+ nginx_rest_api_location : /etc/nginx/conf.d/api.conf
258
+ nginx_rest_api_port : 8080
253
259
nginx_rest_api_write : false
254
260
nginx_rest_api_dashboard : false
255
261
256
262
# Enable uploading NGINX configuration files to your system.
257
263
# Default for uploading files is false.
258
264
# Default location of files is the files folder within the NGINX Ansible role.
259
- nginx_main_push_enable : false
260
- nginx_main_push_location : conf/nginx.conf
261
- nginx_http_push_enable : false
262
- nginx_http_push_location : conf/http/*.conf
263
- nginx_stream_push_enable : false
264
- nginx_stream_push_location : conf/stream/*.conf
265
-
266
- # Configuration variables to create a templated NGINX configuration.
265
+ # Upload the main NGINX configuration file.
266
+ nginx_main_upload_enable : false
267
+ nginx_main_upload_src : conf/nginx.conf
268
+ nginx_main_upload_dest : /etc/nginx
269
+ # Upload HTTP NGINX configuration files.
270
+ nginx_http_upload_enable : false
271
+ nginx_http_upload_src : conf/http/*.conf
272
+ nginx_http_upload_dest : /etc/nginx/conf.d
273
+ # Upload Stream NGINX configuration files.
274
+ nginx_stream_upload_enable : false
275
+ nginx_stream_upload_src : conf/stream/*.conf
276
+ nginx_stream_upload_dest : /etc/nginx/conf.d
277
+ # Upload HTML files.
278
+ nginx_html_upload_enable : false
279
+ nginx_html_upload_src : www/*
280
+ nginx_html_upload_dest : /usr/share/nginx/html
281
+ # Upload SSL certificates and keys.
282
+ nginx_ssl_upload_enable : false
283
+ nginx_ssl_crt_upload_src : ssl/*.crt
284
+ nginx_ssl_crt_upload_dest : /etc/ssl/certs/
285
+ nginx_ssl_key_upload_src : ssl/*.key
286
+ nginx_ssl_key_upload_dest : /etc/ssl/private/
287
+
288
+ # Enable crating dynamic templated NGINX HTMK demo websites.
289
+ nginx_html_demo_template_enable : false
290
+ nginx_html_demo_template :
291
+ default :
292
+ template_file : www/index.html.j2
293
+ html_file_name : index.html
294
+ html_file_location : /usr/share/nginx/html
295
+ app_name : default
296
+
297
+ # Enable creating dynamic templated NGINX configuration files.
267
298
# Defaults are the values found in a fresh NGINX installation.
268
299
nginx_main_template_enable : false
269
- nginx_main_template_user : nginx
270
- nginx_main_template_worker_processes : auto
271
- nginx_main_template_error_level : warn
272
- nginx_main_template_worker_connections : 1024
300
+ nginx_main_template :
301
+ template_file : nginx.conf.j2
302
+ conf_file_name : nginx.conf
303
+ conf_file_location : /etc/nginx/
304
+ user : nginx
305
+ worker_processes : auto
306
+ error_level : warn
307
+ worker_connections : 1024
308
+ http_enable : true
309
+ http_settings :
310
+ keepalive_timeout : 65
311
+ cache : false
312
+ rate_limit : false
313
+ keyval : false
314
+ stream_enable : false
315
+
316
+ # Enable creating dynamic templated NGINX HTTP configuration files.
317
+ # Defaults will not produce a valid configuration. Instead they are meant to showcase
318
+ # the options available for templating. Each key represents a new configuration file.
319
+ # Comment out load_balancer or web_server depending on whether you wish to create a web server
320
+ # or load balancer configuration file.
273
321
nginx_http_template_enable : false
274
- nginx_http_template_keepalive_timeout : 65
275
- nginx_http_template_listen : 80
276
- nginx_http_template_server_name : localhost
322
+ nginx_http_template :
323
+ default :
324
+ template_file : http/default.conf.j2
325
+ conf_file_name : default.conf
326
+ conf_file_location : /etc/nginx/conf.d/
327
+ port : 8081
328
+ server_name : localhost
329
+ error_page : /usr/share/nginx/html
330
+ ssl :
331
+ cert : ssl/default.crt
332
+ key : ssl/default.key
333
+ web_server :
334
+ html_file_location : /usr/share/nginx/html
335
+ html_file_name : index.html
336
+ http_demo_conf : false
337
+ load_balancer :
338
+ proxy_pass : backend
339
+ health_check_plus : false
340
+ upstreams :
341
+ upstream1 :
342
+ name : backend
343
+ lb_method : least_conn
344
+ zone_name : backend
345
+ zone_size : 64k
346
+ sticky_cookie : false
347
+ servers :
348
+ server1 :
349
+ address : localhost
350
+ port : 8081
351
+ weight : 1
352
+ health_check : max_fails=1 fail_timeout=10s
353
+
354
+ # Enable creating dynamic templated NGINX stream configuration files.
277
355
nginx_stream_template_enable : false
278
356
nginx_stream_template_listen : 12345
279
357
` ` `
0 commit comments