ansible-role-nginx/tasks/conf/setup-rest-api.yml

23 lines
559 B
YAML
Raw Normal View History

---
- name: "(Setup: NGINX Plus) Setup NGINX Plus API"
blockinfile:
path: "{{ nginx_rest_api_location }}"
create: yes
block: |
server {
listen {{ nginx_rest_api_port }};
location /api {
2018-09-15 02:27:12 +02:00
{% if nginx_rest_api_write %}
api write=on;
{% else %}
api;
{% endif %}
}
2018-09-15 02:27:12 +02:00
{% if nginx_rest_api_dashboard %}
location = /dashboard.html {
root /usr/share/nginx/html;
}
{% endif %}
}
notify: "(Handler: All OSs) Reload NGINX"