File tree Expand file tree Collapse file tree 6 files changed +28
-25
lines changed Expand file tree Collapse file tree 6 files changed +28
-25
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,7 @@ nginx_status_port: 8080
426
426
# Requires NGINX Plus.
427
427
# Default is false.
428
428
nginx_rest_api_enable : false
429
+ nginx_rest_api_src : api.conf.j2
429
430
nginx_rest_api_location : /etc/nginx/conf.d/api.conf
430
431
nginx_rest_api_port : 8080
431
432
nginx_rest_api_write : false
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ nginx_status_port: 8080
265
265
# Requires NGINX Plus.
266
266
# Default is false.
267
267
nginx_rest_api_enable : false
268
+ nginx_rest_api_src : api.conf.j2
268
269
nginx_rest_api_location : /etc/nginx/conf.d/api.conf
269
270
nginx_rest_api_port : 8080
270
271
nginx_rest_api_write : false
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 64
64
with_dict : " {{ nginx_stream_template }}"
65
65
when : nginx_stream_template_enable
66
66
notify : " (Handler: All OSs) Reload NGINX"
67
+
68
+ - name : " (Setup: All NGINX) Dynamically Generate NGINX API Configuration File"
69
+ template :
70
+ src : " {{ nginx_rest_api_src }}"
71
+ dest : " {{ nginx_rest_api_location }}"
72
+ backup : yes
73
+ notify : " (Handler: All OSs) Reload NGINX"
74
+ when : nginx_rest_api_enable
Original file line number Diff line number Diff line change 44
44
when : nginx_main_template_enable
45
45
or nginx_http_template_enable
46
46
or nginx_stream_template_enable
47
+ or nginx_rest_api_enable
47
48
48
49
- import_tasks : conf/setup-status.yml
49
50
when : nginx_status_enable
50
51
51
- - import_tasks : conf/setup-rest-api.yml
52
- when : nginx_rest_api_enable
53
-
54
52
- import_tasks : conf/debug-output.yml
55
53
when : nginx_debug_output
56
54
Original file line number Diff line number Diff line change
1
+ {{ ansible_managed | comment }}
2
+
3
+ server {
4
+ listen {{ nginx_rest_api_port }};
5
+ location /api {
6
+ {% if nginx_rest_api_write %}
7
+ api write=on;
8
+ {% else %}
9
+ api;
10
+ {% endif %}
11
+ }
12
+ {% if nginx_rest_api_dashboard %}
13
+ location = /dashboard.html {
14
+ root /usr/share/nginx/html;
15
+ }
16
+ {% endif %}
17
+ }
You can’t perform that action at this time.
0 commit comments