-
Notifications
You must be signed in to change notification settings - Fork 26
Enhance overcloud openbao deployment #2477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seunghun1ee
wants to merge
6
commits into
stackhpc/2026.1
Choose a base branch
from
enhance-overcloud-openbao-deployment
base: stackhpc/2026.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c635f1c
Make OpenBao raft leader index configurable
seunghun1ee f888b43
Add playbook for getting current OpenBao Raft leader
seunghun1ee 30290d6
Add timeout to first OpenBao unseal
seunghun1ee f703b5c
Add wrapper playbook for fixing overcloud OpenBao
seunghun1ee a10c29f
Add docs about restoring openbao raft cluster
seunghun1ee d21af91
Prevent running init on wrong node
seunghun1ee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| - name: Get current OpenBao Raft leader | ||
| import_playbook: get-current-raft-leader.yml | ||
|
|
||
| - name: Run deploy playbook with the current raft_leader_index set | ||
| import_playbook: secret-store-deploy-overcloud.yml |
68 changes: 68 additions & 0 deletions
68
etc/kayobe/ansible/secret-store/get-current-raft-leader.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| - name: Get current Raft leader | ||
| hosts: controllers | ||
| vars: | ||
| secret_store_bind_interface: "{{ internal_net_name | net_interface | replace('-', '_') }}" | ||
| secret_store_bind_address: "{{ ansible_facts[secret_store_bind_interface].ipv4.address }}" | ||
| secret_store_api_address: "https://{{ secret_store_bind_address }}:8200" | ||
| tasks: | ||
| - name: Set a fact about the virtualenv on the remote system | ||
| ansible.builtin.set_fact: | ||
| virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}" | ||
| when: | ||
| - ansible_python_interpreter is defined | ||
| - not ansible_python_interpreter.startswith('/bin/') | ||
| - not ansible_python_interpreter.startswith('/usr/bin/') | ||
|
|
||
| - name: Ensure Python hvac module is installed | ||
| ansible.builtin.pip: | ||
| name: hvac | ||
| state: present | ||
| extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" | ||
| virtualenv: "{{ virtualenv is defined | ternary(virtualenv, omit) }}" | ||
| become: "{{ virtualenv is not defined }}" | ||
|
|
||
| - name: Include secret store keys | ||
| ansible.builtin.include_vars: | ||
| file: "{{ kayobe_env_config_path }}/{{ stackhpc_ca_secret_store }}/overcloud-{{ stackhpc_ca_secret_store }}-keys.json" | ||
| name: secret_store_keys | ||
|
|
||
| - name: Query the HA status | ||
| ansible.builtin.uri: | ||
| url: "{{ secret_store_api_address }}/v1/sys/ha-status" | ||
| headers: | ||
| X-Vault-Token: "{{ secret_store_keys.root_token }}" | ||
| follow_redirects: none | ||
| register: ha_status_query | ||
| ignore_errors: true | ||
|
|
||
| - name: Query the leader | ||
| ansible.builtin.uri: | ||
| url: "{{ secret_store_api_address }}/v1/sys/leader" | ||
| headers: | ||
| X-Vault-Token: "{{ secret_store_keys.root_token }}" | ||
| follow_redirects: none | ||
| register: leader_query | ||
| ignore_errors: true | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Determine Raft leader | ||
| ansible.builtin.group_by: | ||
| key: raft_leader | ||
| when: | ||
| - ha_status_query.json is defined | ||
| - leader_query.json is defined | ||
| - ha_status_query.json.nodes | length > 1 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - leader_query.json.is_self | bool | ||
|
|
||
| - name: Assert that there is only one leader | ||
| ansible.builtin.assert: | ||
| that: groups['raft_leader'] | default([]) | length == 1 | ||
| fail_msg: There are multiple OpenBao Raft leader. Check the status of the cluster. | ||
|
|
||
| - name: Set Raft leader index fact | ||
| ansible.builtin.set_fact: | ||
| raft_leader_index: "{{ lookup('ansible.utils.index_of', groups['controllers'], 'eq', (groups['raft_leader'] | first)) }}" | ||
|
coderabbitai[bot] marked this conversation as resolved.
seunghun1ee marked this conversation as resolved.
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Display the index of the Raft leader | ||
| ansible.builtin.debug: | ||
| msg: "raft_leader_index: {{ raft_leader_index }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.