Skip to content

Commit 5d535dc

Browse files
authored
Merge pull request #39 from stackhpc/init_localhost
vault: Introduce vault_init_addr
2 parents 016280d + 0ef94f7 commit 5d535dc

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

roles/vault/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Role variables
2929
* Optional
3030
* `vault_bind_address`: Which IP address should Vault bind to (default: "127.0.0.1")
3131
* `vault_api_addr`: Vault [API addr](https://www.vaultproject.io/docs/configuration#api_addr) - Full URL including protocol and port (default: "http://127.0.0.1:8200")
32+
* `vault_init_addr`: Vault init addr (used only for initialisation purposes) - full URL including protocol and port (default: "http://127.0.0.1:8200")
3233
* `consul_container.etc_hosts`: Dict; `{<hostname>:<ip_address>}` to be added to container /etc/host
3334
s (default: Omitted)
3435
* `vault_extra_volumes`: List of `"<host_location>:<container_mountpoint>"`

roles/vault/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ vault_protocol: "{{ 'https' if vault_tls_key and vault_tls_cert else 'http' }}"
1414
vault_vip_address: "{{ vault_vip_url | default(vault_bind_address) }}"
1515
vault_api_addr: "{{ vault_protocol ~ '://' ~ vault_vip_address ~ ':8200' }}"
1616
vault_bind_address: "127.0.0.1"
17+
vault_init_addr: "http://127.0.0.1:8200"
1718
vault_tls_key: ""
1819
vault_tls_cert: ""
1920

roles/vault/tasks/vault.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
- name: Check if vault is initialized
2020
uri:
21-
url: "{{ vault_api_addr }}/v1/sys/init"
21+
url: "{{ vault_init_addr }}/v1/sys/init"
2222
register: vault_init_status
2323
retries: 50
2424
delay: 1
@@ -29,7 +29,7 @@
2929
block:
3030
- name: Initialize vault
3131
hashivault_init:
32-
url: "{{ vault_api_addr }}"
32+
url: "{{ vault_init_addr }}"
3333
ca_cert: "{{ vault_ca_cert | default(omit) }}"
3434
no_log: true
3535
register: vault_keys_result

0 commit comments

Comments
 (0)