Skip to content

Commit 9377fd7

Browse files
committed
feat: add support for setting leader_ca_cert_file
If `TLS` is used on the `OpenBao` API then raft peers will need to configured with a `CA` certificate to verify the certificates being used by the leader otherwise then could not join.
1 parent df62192 commit 9377fd7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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: 4 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

@@ -59,7 +60,9 @@ openbao_config: >
5960
"path": "/openbao/file",
6061
{% if openbao_raft_leaders | length > 0 %}
6162
"retry_join": {
62-
"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 %}
6366
}
6467
{% endif %}
6568
}

0 commit comments

Comments
 (0)