Manage default vhost. Closes #11

This commit is contained in:
Emilien Mantel
2016-01-21 17:08:01 +01:00
parent c36c4824b7
commit 520eed50c3
5 changed files with 61 additions and 2 deletions

View File

@@ -77,3 +77,17 @@
notify: reload nginx
when: (item.enable is defined and not item.enable) or (item.delete is defined and item.delete)
- name: FILE | Delete default vhost when explicitely defined
file: >
path=/etc/nginx/sites-enabled/default
state=absent
notify: reload nginx
when: nginx_default_vhost is not none
- name: FILE | Auto set default vhost
file: >
src=/etc/nginx/sites-available/default
dest=/etc/nginx/sites-enabled/default
state=link
notify: reload nginx
when: nginx_default_vhost is none