added support for different owner and crypt_scheme
This commit is contained in:
parent
f727f839e9
commit
22340271b1
2 changed files with 9 additions and 3 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
htpasswdfile: {}
|
htpasswdfile: {}
|
||||||
# foo:
|
# foo:
|
||||||
# path: /etc/nginx/htpasswd-something
|
# path: /etc/nginx/htpasswd-something
|
||||||
|
# owner: root
|
||||||
|
# group: www-data
|
||||||
|
# mode: 0640
|
||||||
|
# crypt_scheme: apr_md5_crypt
|
||||||
# users:
|
# users:
|
||||||
# - name: bar
|
# - name: bar
|
||||||
# pw: baz
|
# pw: baz
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
- name: set user and pw
|
- name: set user and pw
|
||||||
with_items: "{{ htpasswdfile[passfile].users }}"
|
with_items: "{{ htpasswdfile[passfile].users }}"
|
||||||
htpasswd:
|
htpasswd:
|
||||||
|
crypt_scheme: "{{ htpasswdfile[passfile].crypt_scheme|d('apr_md5_crypt') }}"
|
||||||
path: "{{ htpasswdfile[passfile].path }}"
|
path: "{{ htpasswdfile[passfile].path }}"
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
password: "{{ item.pw }}"
|
password: "{{ item.pw }}"
|
||||||
owner: root
|
owner: "{{htpasswdfile[passfile].owner|d('root') }}"
|
||||||
group: www-data
|
group: "{{htpasswdfile[passfile].group|d('www-data') }}"
|
||||||
mode: 0640
|
mode: "{{htpasswdfile[passfile].mode|d('0640') }}"
|
||||||
|
state: "{{htpasswdfile[passfile].state|d('present') }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue