ansible-nginx/tasks/htpasswd.yml

19 lines
573 B
YAML

---
- name: FILE | Delete htpasswd file
file:
path: "{{ nginx_htpasswd_dir }}/{{ item.name }}"
state: absent
loop: "{{ nginx_htpasswd }}"
when: item.state is defined and item.state == 'absent'
no_log: "{{ not nginx_debug_role }}"
- name: HTPASSWD | Manage files
htpasswd:
name: "{{ item.1.name }}"
password: "{{ item.1.password }}"
path: "{{ nginx_htpasswd_dir }}/{{ item.0.name }}"
loop: "{{ nginx_htpasswd | subelements('users') }}"
when: item.0.state is not defined or item.0.state == 'present'
no_log: "{{ not nginx_debug_role }}"