2015-12-03 22:32:08 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: FILE | Delete htpasswd file
|
2017-07-27 17:21:10 +07:00
|
|
|
file:
|
|
|
|
path: "{{ nginx_htpasswd_dir }}/{{ item.name }}"
|
|
|
|
state: absent
|
2016-03-05 17:37:37 +07:00
|
|
|
with_items: "{{ nginx_htpasswd }}"
|
2015-12-03 22:32:08 +07:00
|
|
|
when: item.state is defined and item.state == 'absent'
|
2018-03-15 22:10:37 +07:00
|
|
|
no_log: not nginx_debug_role
|
2015-12-03 22:32:08 +07:00
|
|
|
|
|
|
|
- name: HTPASSWD | Manage files
|
2017-07-27 17:21:10 +07:00
|
|
|
htpasswd:
|
|
|
|
name: "{{ item.1.name }}"
|
|
|
|
password: "{{ item.1.password }}"
|
|
|
|
state: "{{ item.1.state | default('present') }}"
|
|
|
|
path: "{{ nginx_htpasswd_dir }}/{{ item.0.name }}"
|
2015-12-03 22:32:08 +07:00
|
|
|
with_subelements:
|
2016-03-05 17:37:37 +07:00
|
|
|
- "{{ nginx_htpasswd }}"
|
2015-12-03 22:32:08 +07:00
|
|
|
- users
|
2016-03-09 17:20:19 +07:00
|
|
|
when: item.0.state is not defined or item.0.state == 'present'
|
2018-03-15 22:10:37 +07:00
|
|
|
no_log: not nginx_debug_role
|