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 }}" password: "{{ item.1.password }}"
state: "{{ item.1.state | default('present') }}" state: "{{ item.1.state | default('present') }}"
path: "{{ nginx_htpasswd_dir }}/{{ item.0.name }}" 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' when: item.0.state is not defined or item.0.state == 'present'
no_log: not nginx_debug_role no_log: not nginx_debug_role

View File

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