feat(vault): enable consul service registration automatically if consul is also enabled #9

Merged
lanson merged 2 commits from feat/vault-consul-integration into main 2024-05-13 21:28:33 +00:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit 340f2137d4 - Show all commits

View File

@ -14,8 +14,14 @@
- name: "Generate consul agents credentials"
ansible.builtin.set_fact:
_cosul_agents_accessor: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
_consul_agents_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
- name: "Generate consul vault credentials"
ansible.builtin.set_fact:
_cosul_vault_accessor: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
_consul_vault_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}"
- name: "Generate nomad credentials"
block:
- name: "Generate nomad root credentials"

View File

@ -3,6 +3,11 @@ consul:
root_token:
secret_id: "{{ _consul_root_token }}"
tokens:
agent: "{{ _consul_agents_token }}"
agent:
accessor_id: "{{ _consul_agents_accesor }}"
secret_id: "{{ _consul_agents_token }}"
vault:
accessor_id: "{{ _consul_vault_accessor }}"
secret_id: "{{ _consul_vault_token }}"
nomad:
root_token: "{{ _nomad_root_token }}"