Skip to content

Commit 2b1ae06

Browse files
authored
Merge pull request #81 from stackhpc/openbao-localhost-fix
feat: add additional `TCP` localhost listener and `leader_ca`
2 parents f6990a9 + 3a5961e commit 2b1ae06

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace: stackhpc
22
name: hashicorp
33
description: >
44
Hashicorp Vault/Consul deployment and configuration
5-
version: "2.7.0"
5+
version: "2.7.1"
66
readme: "README.md"
77
authors:
88
- "Michał Nasiadka"

roles/openbao/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Role variables
3333
* `openbao_ca_cert`: Path to CA certificate used to verify OpenBao server TLS cert
3434
* `openbao_tls_key`: Path to TLS key to use by OpenBao
3535
* `openbao_tls_cert`: Path to TLS cert to use by OpenBao
36+
* `openbao_tls_ca`: Path to TLS CA certificate that can be used by peers to validate the leaders TLS
3637
* `openbao_log_keys`: Whether to log the root token and unseal keys in the Ansible output. Default `false`
3738
* `openbao_set_keys_fact`: Whether to set a `openbao_keys` fact containing the root token and unseal keys. Default `false`
3839
* `openbao_write_keys_file`: Whether to write the root token and unseal keys to a file. Default `false`

roles/openbao/defaults/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ openbao_cluster_name: ""
1313

1414
openbao_tls_key: ""
1515
openbao_tls_cert: ""
16+
openbao_tls_ca: ""
1617

1718
openbao_protocol: "{{ 'https' if openbao_tls_key and openbao_tls_cert else 'http' }}"
1819

@@ -44,15 +45,24 @@ openbao_config: >
4445
{% else %}
4546
"tls_disable": "true"
4647
{% endif %}
48+
}{% if not openbao_bind_addr.startswith('127.') %},
49+
},
50+
{
51+
"tcp": {
52+
"address": "127.0.0.1:8200",
53+
"tls_disable": "true"
4754
}
55+
{% endif %}
4856
}],
4957
"storage": {
5058
"raft": {
5159
"node_id": "raft_{{ inventory_hostname }}",
5260
"path": "/openbao/file",
5361
{% if openbao_raft_leaders | length > 0 %}
5462
"retry_join": {
55-
"leader_api_addr": "{{ openbao_protocol }}://{{ openbao_raft_leaders | first }}:{{ openbao_api_port }}"
63+
"leader_api_addr": "{{ openbao_protocol }}://{{ openbao_raft_leaders | first }}:{{ openbao_api_port }}"{% if openbao_tls_ca %},
64+
"leader_ca_cert_file": "/openbao/config/{{ openbao_tls_ca }}"
65+
{% endif %}
5666
}
5767
{% endif %}
5868
}

0 commit comments

Comments
 (0)