File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ Role variables
1818* Vault
1919 * Mandatory
2020 * ` vault_cluster_name ` : Vault cluster name (e.g. "prod_cluster")
21+ * ` vault_bind_address ` : Which IP address should Vault bind to
22+ * ` vault_vip_address ` : Under which IP address Vault should be available (this role does not deploy keepalived)
2123 * ` vault_tls_key ` : Path to TLS key to use by Vault
2224 * ` vault_tls_cert ` : Path to TLS cert to use by Vault
25+ * ` vault_config_dir ` : Directory into which to bind mount Vault configuration
2326 * Optional
2427 * ` consul_container.etc_hosts ` : Dict; ` {<hostname>:<ip_address>} ` to be added to container /etc/host
2528s (default: Omitted)
@@ -70,7 +73,7 @@ Example playbook (used with OpenStack Kayobe)
7073 consul_bind_ip: "{{ internal_net_ips[ansible_hostname] }}"
7174 consul_vip_address: "{{ internal_net_vip_address }}"
7275 vault_bind_address: "{{ external_net_ips[ansible_hostname] }}"
73- vault_vip_url : "{{ external_net_fqdn }}"
76+ vault_vip_address : "{{ external_net_fqdn }}"
7477 vault_config_dir: "/opt/kayobe/vault"
7578```
7679
Original file line number Diff line number Diff line change @@ -9,9 +9,14 @@ vault_docker_image: "vault"
99vault_docker_tag : " latest"
1010
1111vault_cluster_name : " "
12+ # Allow vault_vip_url for backwards compatibility.
13+ vault_vip_address : " {{ vault_vip_url | default('') }}"
14+ vault_bind_address : " "
1215vault_tls_key : " "
1316vault_tls_cert : " "
1417
18+ vault_config_dir : " "
19+
1520vault_config : >
1621 {
1722 "cluster_name": "{{ vault_cluster_name }}",
Original file line number Diff line number Diff line change 1717
1818- name : Check if vault is initialized
1919 uri :
20- url : " https://{{ vault_vip_url }}:8200/v1/sys/init"
20+ url : " https://{{ vault_vip_address }}:8200/v1/sys/init"
2121 register : vault_init_status
2222 retries : 50
2323 delay : 1
2424 until : vault_init_status.status == 200
2525
2626- name : Initialize vault
27- command : " docker exec -e 'VAULT_ADDR=https://{{ vault_vip_url }}:8200' {{ vault_docker_name }} vault operator init -format yaml"
27+ command : " docker exec -e 'VAULT_ADDR=https://{{ vault_vip_address }}:8200' {{ vault_docker_name }} vault operator init -format yaml"
2828 when : not vault_init_status.json.initialized
2929 run_once : True
3030 register : vault_init_output
You can’t perform that action at this time.
0 commit comments