Skip to content

Commit 759761c

Browse files
jackhodgkissbbezak
authored andcommitted
feat: add support for HA Raft in OpenBao
1 parent 07128e6 commit 759761c

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed

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

Lines changed: 28 additions & 1 deletion
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:
@@ -91,6 +96,28 @@
9196
vault_unseal_keys: "{{ openbao_keys.keys_base64 }}"
9297
environment:
9398
https_proxy: ""
99+
run_once: true
100+
101+
# As the first instance is now unsealed the other instances will now need some
102+
# time to connect before we can proceed.
103+
- name: Wait for OpenBao Raft peers to connect
104+
ansible.builtin.wait_for:
105+
timeout: 30
106+
delegate_to: localhost
107+
108+
# Raft peers take few seconds before they report an unsealed state therefore
109+
# we must wait.
110+
- name: Unseal OpenBao
111+
ansible.builtin.import_role:
112+
name: stackhpc.hashicorp.vault_unseal
113+
vars:
114+
vault_api_addr: https://{{ internal_net_name | net_ip }}:8200
115+
vault_unseal_token: "{{ openbao_keys.root_token }}"
116+
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' }}"
117+
vault_unseal_keys: "{{ openbao_keys.keys_base64 }}"
118+
vault_unseal_timeout: 10
119+
environment:
120+
https_proxy: ""
94121

95122
- name: Configure PKI
96123
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ collections:
99
- name: stackhpc.pulp
1010
version: 0.5.5
1111
- name: stackhpc.hashicorp
12-
version: 2.6.1
12+
source: https://github.com/stackhpc/ansible-collection-hashicorp
13+
type: git
14+
version: openbao-localhost-fix
1315
- name: stackhpc.kayobe_workflows
1416
version: 1.1.0
1517
roles:

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)