2015-12-03 22:32:08 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: FILE | Delete htpasswd file
|
2021-09-01 16:58:39 +07:00
|
|
|
ansible.builtin.file:
|
2017-07-27 17:21:10 +07:00
|
|
|
path: "{{ nginx_htpasswd_dir }}/{{ item.name }}"
|
|
|
|
state: absent
|
2019-02-05 03:25:25 +07:00
|
|
|
loop: "{{ nginx_htpasswd }}"
|
2015-12-03 22:32:08 +07:00
|
|
|
when: item.state is defined and item.state == 'absent'
|
2021-09-01 16:02:45 +07:00
|
|
|
no_log: "{{ not nginx_debug_role }}"
|
2015-12-03 22:32:08 +07:00
|
|
|
|
|
|
|
- name: HTPASSWD | Manage files
|
2021-09-10 21:44:08 +07:00
|
|
|
community.general.htpasswd:
|
2017-07-27 17:21:10 +07:00
|
|
|
name: "{{ item.1.name }}"
|
|
|
|
password: "{{ item.1.password }}"
|
|
|
|
path: "{{ nginx_htpasswd_dir }}/{{ item.0.name }}"
|
2021-09-01 16:45:44 +07:00
|
|
|
mode: 0644
|
|
|
|
owner: root
|
|
|
|
group: root
|
2019-02-08 04:29:34 +07:00
|
|
|
loop: "{{ nginx_htpasswd | subelements('users') }}"
|
2016-03-09 17:20:19 +07:00
|
|
|
when: item.0.state is not defined or item.0.state == 'present'
|
2021-09-01 16:02:45 +07:00
|
|
|
no_log: "{{ not nginx_debug_role }}"
|