ansible-role-nginx/tasks/conf/setup-rest-api.yml
Alessandro Fael Garcia 13a847234e Refactor templating
* Add more advanced HTTP templating options
* Let users choose the upload destination when uploading files
* Implement the ability to print your NGINX configuration to your terminal after running a playbook
2018-10-16 11:52:04 -07:00

23 lines
559 B
YAML

---
- 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 {
{% if nginx_rest_api_write %}
api write=on;
{% else %}
api;
{% endif %}
}
{% if nginx_rest_api_dashboard %}
location = /dashboard.html {
root /usr/share/nginx/html;
}
{% endif %}
}
notify: "(Handler: All OSs) Reload NGINX"