@@ -31,8 +31,38 @@ s (default: Omitted)
3131 * ` vault_extra_volumes ` : List of ` "<host_location>:<container_mountpoint>" `
3232 * ` vault_tls_key ` : Path to TLS key to use by Vault
3333 * ` vault_tls_cert ` : Path to TLS cert to use by Vault
34+ * ` vault_log_keys ` : Whether to log the root token and unseal keys in the Ansible output. Default ` false `
35+ * ` vault_set_keys_fact ` : Whether to set a ` vault_keys ` fact containing the root token and unseal keys. Default ` false `
36+ * ` vault_write_keys_file ` : Whether to write the root token and unseal keys to a file. Default ` false `
37+ * ` vault_write_keys_file_host ` : Host on which to write root token and unseal keys. Default ` localhost `
38+ * ` vault_write_keys_file_path ` : Path of file to write root token and unseal keys. Default ` vault-keys.json `
3439
40+ Root and unseal keys
41+ --------------------
3542
43+ After Vault has been initialised, a root token and a set of unseal keys are emitted.
44+ It is very important to store these keys safely and securely.
45+ This role provides several mechanisms for extracting the root token and unseal keys:
46+
47+ 1 . Print to Ansible log output (` vault_log_keys ` )
48+ 1 . Set a ` vault_keys ` fact (` vault_set_keys_fact ` )
49+ 1 . Write to a file (` vault_write_keys_file ` )
50+
51+ In each case, the output will contain the following:
52+
53+ ``` json
54+ {
55+ "keys" : [
56+ " ..." ,
57+ " ..."
58+ ],
59+ "keys_base64" : [
60+ " ..." ,
61+ " ..."
62+ ],
63+ "root_token" : " ..."
64+ }
65+ ```
3666
3767Example playbook (used with OpenStack Kayobe)
3868---------------------------------------------
@@ -96,21 +126,4 @@ Example post-config playbook to enable secrets engines:
96126 run_once: True
97127```
98128
99- Example vault unseal playbook based on Kayobe's secrets.yml
100- ```
101- ---
102- - name: Unseal vault
103- any_errors_fatal: True
104- gather_facts: True
105- hosts: vault
106- tasks:
107- - name: Unseal vault
108- hashivault_unseal:
109- url: "https://sparrow.cf.ac.uk:8200"
110- keys: "{{ item }}"
111- run_once: True
112- with_items: "{{ secrets_vault_keys.unseal_keys_b64 }}"
113- no_log: True
114- ```
115-
116129NOTE: secrets_external_tls_cert/key are variables in Kayobe's secrets.yml
0 commit comments