2017-02-08 21:41:36 +00:00
|
|
|
---
|
|
|
|
- name: shared/gen_userpass | Create the Username/Password combo for the role
|
2018-05-11 16:11:38 +00:00
|
|
|
hashivault_userpass_create:
|
|
|
|
url: "{{ vault_leader_url }}"
|
|
|
|
token: "{{ vault_root_token }}"
|
|
|
|
ca_cert: "{{ vault_cert_dir }}/ca.pem"
|
|
|
|
name: "{{ gen_userpass_username }}"
|
|
|
|
pass: "{{ gen_userpass_password }}"
|
|
|
|
policies:
|
|
|
|
- "{{ gen_userpass_role }}"
|
2017-09-05 08:05:06 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: shared/gen_userpass | Ensure destination directory exists
|
|
|
|
file:
|
|
|
|
path: "{{ vault_roles_dir }}/{{ gen_userpass_role }}"
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: shared/gen_userpass | Copy credentials to all hosts in the group
|
|
|
|
copy:
|
|
|
|
content: >
|
2017-08-24 09:09:52 +00:00
|
|
|
{{
|
2017-02-08 21:41:36 +00:00
|
|
|
{'username': gen_userpass_username,
|
|
|
|
'password': gen_userpass_password} | to_nice_json(indent=4)
|
|
|
|
}}
|
|
|
|
dest: "{{ vault_roles_dir }}/{{ gen_userpass_role }}/userpass"
|