ansible-role-nginx/tasks/conf/setup-status.yml
Alessandro Fael Garcia feda384b94 Improve role handling (#128)
* Improve role handling

* Add defaults to some tasks

* Improve template conditionals
2019-05-21 16:23:06 +01:00

33 lines
1.0 KiB
YAML

---
- name: "(Setup: NGINX Open Source) Enable NGINX Open Source Status"
blockinfile:
path: "{{ (nginx_http_template_enable) | ternary('/etc/nginx/conf.d/http/stub_status.conf','/etc/nginx/conf.d/stub_status.conf') }}"
create: yes
block: |
server {
listen 127.0.0.1:{{ nginx_status_port | default('8080') }};
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
when: nginx_type == "opensource"
notify: "(Handler: All OSs) Reload NGINX"
- name: "(Setup: NGINX Plus) Enable NGINX Plus Status"
blockinfile:
path: "{{ (nginx_http_template_enable) | ternary('/etc/nginx/conf.d/http/status.conf','/etc/nginx/conf.d/status.conf') }}"
create: yes
block: |
server {
listen 127.0.0.1:{{ nginx_status_port | default('8080') }};
location /status {
status;
allow 127.0.0.1;
deny all;
}
}
when: nginx_type == "plus"
notify: "(Handler: All OSs) Reload NGINX"