Some fixes

pull/38/head
Emilien Mantel 2019-02-07 22:29:34 +01:00
parent c399bf35b5
commit 3642df1d5f
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,6 @@
password: "{{ item.1.password }}"
state: "{{ item.1.state | default('present') }}"
path: "{{ nginx_htpasswd_dir }}/{{ item.0.name }}"
loop: "{{ nginx_htpasswd | subelements(users) }}"
loop: "{{ nginx_htpasswd | subelements('users') }}"
when: item.0.state is not defined or item.0.state == 'present'
no_log: not nginx_debug_role

View File

@ -53,9 +53,11 @@
file:
path: "{{ nginx_etc_dir }}/{{ item.1 }}/{{ item.0 | nginx_site_filename }}"
state: absent
loop: "{{ nginx_sites | product(['sites-available', 'sites-enabled']) }}"
loop: "{{ nginx_sites | product(dirs) | list }}"
notify: ['reload nginx', 'restart nginx freebsd']
when: item.0.state is defined and item.0.state == 'absent'
vars:
dirs: ['sites-available', 'sites-enabled']
loop_control:
label: "{{ nginx_etc_dir }}/{{ item.1 }}/{{ item.0 | nginx_site_filename }}"