Initial commit
This commit is contained in:
commit
f727f839e9
3 changed files with 24 additions and 0 deletions
6
defaults/main.yml
Normal file
6
defaults/main.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
htpasswdfile: {}
|
||||
# foo:
|
||||
# path: /etc/nginx/htpasswd-something
|
||||
# users:
|
||||
# - name: bar
|
||||
# pw: baz
|
||||
9
tasks/htpasswdfile.yml
Normal file
9
tasks/htpasswdfile.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
- name: set user and pw
|
||||
with_items: "{{ htpasswdfile[passfile].users }}"
|
||||
htpasswd:
|
||||
path: "{{ htpasswdfile[passfile].path }}"
|
||||
name: "{{ item.name }}"
|
||||
password: "{{ item.pw }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: 0640
|
||||
9
tasks/main.yml
Normal file
9
tasks/main.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
- name: install python requirements
|
||||
apt:
|
||||
pkg: python-passlib
|
||||
|
||||
- name: generate passwordfile
|
||||
with_items: "{{ htpasswdfile }}"
|
||||
loop_control:
|
||||
loop_var: passfile
|
||||
include_tasks: htpasswdfile.yml
|
||||
Loading…
Add table
Add a link
Reference in a new issue