Bug fix: vhost with absent state is not deleted in sites-enabled
parent
eb704da8d8
commit
ef3440a015
|
@ -48,8 +48,10 @@
|
||||||
when: item.state is not defined or item.state != 'absent'
|
when: item.state is not defined or item.state != 'absent'
|
||||||
|
|
||||||
- name: FILE | Delete vhosts
|
- name: FILE | Delete vhosts
|
||||||
file: path={{ nginx_etc_dir }}/sites-available/{{ item.filename | default(item.name if item.name is string else item.name[0]) }} state=absent
|
file: path={{ nginx_etc_dir }}/{{ item.1 }}/{{ item.0.filename | default(item.0.name if item.0.name is string else item.0.name[0]) }} state=absent
|
||||||
with_items: "{{ nginx_vhosts }}"
|
with_nested:
|
||||||
|
- "{{ nginx_vhosts }}"
|
||||||
|
- ['sites-available', 'sites-enabled']
|
||||||
notify: ['reload nginx', 'restart nginx freebsd']
|
notify: ['reload nginx', 'restart nginx freebsd']
|
||||||
when: item.state is defined and item.state == 'absent'
|
when: item.state is defined and item.state == 'absent'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue