1
0
Fork 0

Fix vhost enabled removal

This commit is contained in:
Daniele Tricoli 2021-01-29 02:30:00 +01:00
parent 1ce67c8f51
commit 9440abe704

View file

@ -32,10 +32,17 @@
with_items: "{{ nginx_vhosts }}"
notify: systemctl restart nginx
- name: collect all vhost enabled
find:
paths: /etc/nginx/sites-enabled/
patterns: "*.vhost"
register: vhost_to_delete
- name: remove all the vhost enabled
file:
path: /etc/nginx/sites-enabled/*.vhost
path: "{{ item.path }}"
state: absent
with_items: "{{ vhost_to_delete.files }}"
notify: systemctl restart nginx
- name: add vhost configuration sylink for {{ item.servername }}