Skip to content

Commit ae13db3

Browse files
authored
Merge pull request #1694 from stackhpc/openbao-ha-raft
Add support for OpenBao with HA Raft
2 parents 07128e6 + 7cc1943 commit ae13db3

File tree

8 files changed

+51
-8
lines changed

8 files changed

+51
-8
lines changed

doc/source/configuration/monitoring.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,18 @@ for the exporter.
169169
If you are deploying in a cloud with internal TLS, you may be required
170170
to provide a CA certificate for the OpenStack Capacity exporter if your
171171
certificate is not signed by a trusted CA. For example, to use a CA certificate
172-
named ``vault.crt`` that is also added to the Kolla containers:
172+
named ``vault.crt`` or ``openbao.crt`` that is also added to the Kolla containers:
173173

174174
.. code-block:: yaml
175175
176176
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/vault.crt"
177177
178+
or
179+
180+
.. code-block:: yaml
181+
182+
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/openbao.crt"
183+
178184
Alternatively, to disable certificate verification for the OpenStack Capacity
179185
exporter:
180186

etc/kayobe/ansible/openbao-deploy-overcloud.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
gather_facts: true
2222
hosts: controllers
2323
vars:
24-
openbao_bind_address: "{{ internal_net_name | net_ip }}"
24+
openbao_bind_addr: "{{ internal_net_name | net_ip }}"
25+
# This is the IP address of the first controller and therefore the leader within
26+
# OpenBao. This could be replaced with the VIP address of the internal network if
27+
# HAProxy has been configured to load balance the OpenBao API.
28+
openbao_raft_leaders:
29+
- "{{ internal_net_name | net_ip(inventory_hostname=groups['controllers'][0]) }}"
2530
tasks:
2631
- name: Set a fact about the virtualenv on the remote system
2732
ansible.builtin.set_fact:
@@ -46,7 +51,7 @@
4651

4752
- name: Template out TLS key and cert
4853
ansible.builtin.copy:
49-
# Within the OpenBao container these uids & gids map to the vault user
54+
# Within the OpenBao container these uids & gids map to the openbao user
5055
src: "{{ kayobe_env_config_path }}/openbao/{{ item }}"
5156
dest: /opt/kayobe/openbao/{{ item }}
5257
owner: 100
@@ -55,6 +60,7 @@
5560
loop:
5661
- "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.crt"
5762
- "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.key"
63+
- "OS-TLS-INT.crt"
5864
become: true
5965

6066
- name: Apply OpenBao role
@@ -71,6 +77,7 @@
7177
openbao_docker_tag: "{{ overcloud_openbao_docker_tag }}"
7278
openbao_tls_cert: "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.crt"
7379
openbao_tls_key: "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.key"
80+
openbao_tls_ca: "OS-TLS-INT.crt"
7481
copy_self_signed_ca: true
7582
openbao_api_addr: https://{{ internal_net_name | net_ip }}:8200
7683
openbao_write_keys_file: true
@@ -91,6 +98,28 @@
9198
vault_unseal_keys: "{{ openbao_keys.keys_base64 }}"
9299
environment:
93100
https_proxy: ""
101+
run_once: true
102+
103+
# As the first instance is now unsealed the other instances will now need some
104+
# time to connect before we can proceed.
105+
- name: Wait for OpenBao Raft peers to connect
106+
ansible.builtin.wait_for:
107+
timeout: 30
108+
delegate_to: localhost
109+
110+
# Raft peers take few seconds before they report an unsealed state therefore
111+
# we must wait.
112+
- name: Unseal OpenBao
113+
ansible.builtin.import_role:
114+
name: stackhpc.hashicorp.vault_unseal
115+
vars:
116+
vault_api_addr: https://{{ internal_net_name | net_ip }}:8200
117+
vault_unseal_token: "{{ openbao_keys.root_token }}"
118+
vault_unseal_ca_cert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if ansible_facts.os_family == 'RedHat' else '/usr/local/share/ca-certificates/OS-TLS-ROOT.crt' }}"
119+
vault_unseal_keys: "{{ openbao_keys.keys_base64 }}"
120+
vault_unseal_timeout: 10
121+
environment:
122+
https_proxy: ""
94123

95124
- name: Configure PKI
96125
any_errors_fatal: true

etc/kayobe/ansible/openbao-deploy-seed.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
gather_facts: true
55
hosts: seed
66
vars:
7-
openbao_bind_address: "{{ ansible_facts['lo'].ipv4.address }}"
8-
openbao_api_addr: "http://{{ openbao_bind_address }}:8200"
7+
openbao_bind_addr: "{{ ansible_facts['lo'].ipv4.address }}"
8+
openbao_api_addr: "http://{{ openbao_bind_addr }}:8200"
99
tasks:
1010
- name: Set a fact about the virtualenv on the remote system
1111
ansible.builtin.set_fact:

etc/kayobe/ansible/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ collections:
99
- name: stackhpc.pulp
1010
version: 0.5.5
1111
- name: stackhpc.hashicorp
12-
version: 2.6.1
12+
version: 2.7.1
1313
- name: stackhpc.kayobe_workflows
1414
version: 1.1.0
1515
roles:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
# Path to a CA certificate file to trust in the OpenStack Capacity exporter.
3-
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/vault.crt"
3+
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/openbao.crt"

etc/kayobe/environments/ci-multinode/tempest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
rally_no_sensitive_log: false
44

55
# Add the Vault CA certificate to the rally container when running tempest.
6-
tempest_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/vault.crt"
6+
tempest_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/openbao.crt"

etc/kayobe/inventory/group_vars/all/openbao.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ seed_openbao_pki_certificate_subject:
7777
role: "{{ seed_openbao_pki_role_name }}"
7878
extra_params:
7979
ip_sans: "{% for host in groups['controllers'] %}{{ internal_net_name | net_ip(host) }}{% if not loop.last %},{% endif %}{% endfor %},{{ kolla_internal_vip_address }}"
80+
81+
# Enable OpenBao UI
82+
openbao_enable_ui: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Add support for highly available Raft when using OpenBao on
5+
overcloud hosts.

0 commit comments

Comments
 (0)