fix: various small issues on generate playbooks

This commit is contained in:
Bertrand Lanson 2024-05-03 22:27:42 +02:00
parent 0a1ddc63bf
commit b66113b84c
2 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,5 @@
--- ---
# hashistack deployment playbook # hashistack generate certificates playbook
- name: "Generate certificates" - name: "Generate certificates"
hosts: all hosts: all
strategy: linear strategy: linear

View File

@ -10,22 +10,24 @@
block: block:
- name: "Generate consul root credentials" - name: "Generate consul root credentials"
ansible.builtin.set_fact: ansible.builtin.set_fact:
_consul_root_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}" _consul_root_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
- name: "Generate consul agents credentials" - name: "Generate consul agents credentials"
ansible.builtin.set_fact: ansible.builtin.set_fact:
_consul_agents_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}" _consul_agents_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
- name: "Generate nomad credentials" - name: "Generate nomad credentials"
block: block:
- name: "Generate nomad root credentials" - name: "Generate nomad root credentials"
ansible.builtin.set_fact: ansible.builtin.set_fact:
_nomad_root_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}" _nomad_root_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
- name: "Write credentials file" - name: "Write credentials file"
ansible.builtin.template: ansible.builtin.template:
src: credentials.yml.j2 src: templates/credentials.yml.j2
dest: credentials.yml dest: "{{ sub_configuration_directories['secrets'] }}/{{ configuration_credentials_vars_file }}"
owner: "{{ lookup('env', 'USER') }}"
group: "{{ lookup('env', 'USER') }}"
mode: '0644' mode: '0644'
- fail: # - fail: