pwgen: rewrite checks and passwords generation
This commit is contained in:
@ -1,7 +1,22 @@
|
||||
- name: Create passwords.yaml file
|
||||
- name: Check that passwords.yaml exists
|
||||
stat:
|
||||
path: "{{ inventory_dir }}/group_vars/all/passwords.yaml"
|
||||
register: passwords_file
|
||||
|
||||
- name: Create passwords.yaml file if not exists
|
||||
file:
|
||||
name: "{{ inventory_dir }}/group_vars/all/passwords.yaml"
|
||||
state: touch
|
||||
when: not passwords_file.stat.exists
|
||||
|
||||
- name: Read passwords.yaml file
|
||||
slurp:
|
||||
src: "{{ inventory_dir }}/group_vars/all/passwords.yaml"
|
||||
register: passwords_b64
|
||||
|
||||
- name: Set facts about passwords
|
||||
set_fact:
|
||||
passwords: "{{ passwords_b64['content'] | b64decode | from_yaml }}"
|
||||
|
||||
- name: Create files directory for ddclient tsig
|
||||
file:
|
||||
|
Reference in New Issue
Block a user