code cleanup

This commit is contained in:
nd 2021-08-15 02:36:47 +02:00
parent 4317a4c92c
commit 99b32b4f76
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9

View file

@ -1,12 +1,16 @@
- set_fact:
current_users: "{{ htpasswdfile[passfile].users }}"
current_file: "{{ htpasswdfile[passfile] }}"
- name: set user and pw
no_log: True
with_items: "{{ htpasswdfile[passfile].users }}"
loop: "{{ current_users }}"
htpasswd:
crypt_scheme: "{{ htpasswdfile[passfile].crypt_scheme|d('apr_md5_crypt') }}"
path: "{{ htpasswdfile[passfile].path }}"
crypt_scheme: "{{ current_file.crypt_scheme|d('apr_md5_crypt') }}"
path: "{{ current_file.path }}"
name: "{{ item.name }}"
password: "{{ item.pw }}"
owner: "{{ htpasswdfile[passfile].owner|d('root') }}"
group: "{{ htpasswdfile[passfile].group|d('www-data') }}"
mode: "{{ htpasswdfile[passfile].mode|d('0640') }}"
owner: "{{ current_file.owner|d('root') }}"
group: "{{ current_file.group|d('www-data') }}"
mode: "{{ current_file.mode|d('0640') }}"
state: "{{ item.state|d('present') }}"