feat: add playbook to generate credentials before deploying
This commit is contained in:
parent
1a83036506
commit
489f9aa101
31
playbooks/generate_credentials.yml
Normal file
31
playbooks/generate_credentials.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
# hashistack generate certificates playbook
|
||||||
|
- name: "Generate credentials"
|
||||||
|
hosts: localhost
|
||||||
|
strategy: linear
|
||||||
|
gather_facts: true
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: "Generate consul credentials"
|
||||||
|
block:
|
||||||
|
- name: "Generate consul root credentials"
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
_consul_root_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}"
|
||||||
|
|
||||||
|
- name: "Generate consul agents credentials"
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
_consul_agents_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}"
|
||||||
|
|
||||||
|
- name: "Generate nomad credentials"
|
||||||
|
block:
|
||||||
|
- name: "Generate nomad root credentials"
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
_nomad_root_token: "{{ lookup('uuid', namespace='00000000-0000-0000-0000-000000000000') }}"
|
||||||
|
|
||||||
|
- name: "Write credentials file"
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: credentials.yml.j2
|
||||||
|
dest: credentials.yml
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
- fail:
|
Loading…
Reference in New Issue
Block a user