public-health-ch/ansible/roles/web/tasks/nginx.yaml
2017-04-24 14:22:51 +02:00

19 lines
457 B
YAML

---
- name: Test and reload Nginx
service: name=nginx state=reloaded
# Note that changing the domain leaves the old config in place
- name: Copy Nginx site config
template:
src: nginx.conf.j2
dest: /etc/nginx/sites-available/{{ domain }}
- name: Activate Nginx site config
file:
state: link
src: /etc/nginx/sites-available/{{ domain }}
path: /etc/nginx/sites-enabled/{{ domain }}
notify:
- validate nginx
- reload nginx