additional checks when vault is already configured
This commit is contained in:
parent
23b95a4146
commit
09d664dc09
1 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,17 @@
|
|||
vault_headers: "{{ vault_client_headers|combine({'X-Vault-Token': vault_init_result.json.root_token}) }}"
|
||||
when: not vault_cluster_is_initialized and inventory_hostname == groups.vault|first
|
||||
|
||||
- name: "cluster/init | Get existent root_token"
|
||||
command: "cat {{ vault_secrets_dir }}/root_token"
|
||||
register: existent_root_token
|
||||
when: vault_cluster_is_initialized
|
||||
|
||||
- name: cluster/init | Fix facts for existent vault cluster
|
||||
set_fact:
|
||||
vault_root_token: "{{ existent_root_token.stdout }}"
|
||||
vault_headers: "{{ vault_client_headers|combine({'X-Vault-Token': existent_root_token.stdout}) }}"
|
||||
when: vault_cluster_is_initialized
|
||||
|
||||
- name: cluster/init | Ensure all hosts have these facts
|
||||
set_fact:
|
||||
vault_unseal_keys: "{{ hostvars[groups.vault|first]['vault_unseal_keys'] }}"
|
||||
|
|
Loading…
Reference in a new issue