Skip to content

Enhance overcloud openbao deployment (2025.1 backport) - #2596

Open
seunghun1ee wants to merge 7 commits into
stackhpc/2025.1from
enhance-overcloud-openbao-deployment-epoxy
Open

Enhance overcloud openbao deployment (2025.1 backport)#2596
seunghun1ee wants to merge 7 commits into
stackhpc/2025.1from
enhance-overcloud-openbao-deployment-epoxy

Conversation

@seunghun1ee

Copy link
Copy Markdown
Member

Currently fixing split brain OpenBao cluster is not a smooth operation.
Added following to improve the cluster restoration process

  • A playbook for finding current OpenBao Raft leader
  • A variable in deployment playbook for setting leader node
  • Documentation for this procedure
    Also added 10 seconds timeout on unsealing first OpenBao node to prevent the deployment playbook from failing caused by slightly longer unsealing time when fixing the cluster.

Added variable ``raft_leader_index`` to the
``secret-store-deploy-overcloud.yml`` playbook. This variable controls
which controller becomes the leader when deploying OpenBao.
The default is 0 (Frist controller).

This variable needs to track the index of current leader controller when
fixing/restarting the cluster to prevent split brain.

(cherry picked from commit 2aee0d9)
(cherry picked from commit dafac0f)
(cherry picked from commit 0fc22a2)
@seunghun1ee seunghun1ee self-assigned this Sep 14, 2026
@seunghun1ee
seunghun1ee requested a review from a team as a code owner September 14, 2026 08:29
@github-actions github-actions Bot added the waiting-review PR is waiting for a review label Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Summary

Improves 2025.1 OpenBao recovery by detecting the current Raft leader and passing its index to deployment. Adds a recovery playbook and restoration documentation. Increases the first-node unseal timeout to 10 seconds to support longer recovery operations.

Walkthrough

Adds leader detection for OpenBao Raft, updates deployment to use the detected leader, adds a recovery wrapper playbook, and documents automated and manual cluster restoration procedures.

Changes

OpenBao recovery

Layer / File(s) Summary
Leader-aware deployment
etc/kayobe/ansible/secret-store/secret-store-deploy-overcloud.yml
The playbook uses configurable leader index and address values. It derives OpenBao initialisation settings and delegates unsealing to the selected controller.
Raft leader detection
etc/kayobe/ansible/secret-store/get-current-raft-leader.yml
The new playbook queries OpenBao status endpoints, asserts one leader, and sets raft_leader_index.
Recovery workflow and documentation
etc/kayobe/ansible/secret-store/fix-openbao-overcloud.yml, doc/source/configuration/openbao.rst
The wrapper playbook detects the current leader before deployment. The documentation describes automated and manual restoration procedures.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant FixPlaybook
  participant LeaderPlaybook
  participant DeployPlaybook
  Operator->>FixPlaybook: Run fix-openbao-overcloud.yml
  FixPlaybook->>LeaderPlaybook: Import get-current-raft-leader.yml
  LeaderPlaybook-->>FixPlaybook: Set raft_leader_index
  FixPlaybook->>DeployPlaybook: Import secret-store-deploy-overcloud.yml
  DeployPlaybook-->>Operator: Complete leader-aware deployment
Loading

Merge Risk: 🟠 High · up to 07425

The new recovery workflow can fail to identify or unseal the actual leader, undermining the split-brain restoration feature. These issues should be fixed before merge.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4c9c26a6-386c-40c8-b4ad-fa41410b0aad

📥 Commits

Reviewing files that changed from the base of the PR and between a8ba4bb and 0742561.

📒 Files selected for processing (4)
  • doc/source/configuration/openbao.rst
  • etc/kayobe/ansible/secret-store/fix-openbao-overcloud.yml
  • etc/kayobe/ansible/secret-store/get-current-raft-leader.yml
  • etc/kayobe/ansible/secret-store/secret-store-deploy-overcloud.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: stackhpc/check
  • GitHub Check: Ansible 2.17 lint with Python 3.10
  • GitHub Check: Ansible 2.18 lint with Python 3.12
🧰 Additional context used
🪛 Checkov (3.3.13)
etc/kayobe/ansible/secret-store/get-current-raft-leader.yml

[medium] 30-40: Ensure that HTTPS url is used with uri

(CKV2_ANSIBLE_1)


[medium] 39-49: Ensure that HTTPS url is used with uri

(CKV2_ANSIBLE_1)

🔇 Additional comments (2)
etc/kayobe/ansible/secret-store/secret-store-deploy-overcloud.yml (1)

26-34: LGTM!

Also applies to: 105-107, 133-133

etc/kayobe/ansible/secret-store/fix-openbao-overcloud.yml (1)

2-6: LGTM!

Comment on lines +649 to +656
TASK [Display the index of the Raft leader] ***********************************
Monday 03 August 2026 12:15:02 +0000 (0:00:00.148) 0:00:07.797 *********
ok: [controller-01] =>
msg: 'raft_leader_index: 2'
ok: [controller-02] =>
msg: 'raft_leader_index: 2'
ok: [controller-03] =>
msg: 'raft_leader_index: 2'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the run_once transcript.

Display the index of the Raft leader uses run_once: true, so Ansible shows one controller result. The example shows three results. Show one result in the transcript.

name: secret_store_keys

- name: Query the HA status
ansible.builtin.uri:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bypass proxies for controller-local status requests.

These tasks run on every controller, but uri uses a proxy by default. In a walled-garden configuration that follows the documented no_proxy entry for only the first controller, requests from other controllers can fail. ignore_errors then hides the request error and the assertion reports no leader. Set use_proxy: false on both URI tasks. (docs.ansible.com)

Also applies to: 40-40

🧰 Tools
🪛 Checkov (3.3.13)

[medium] 30-40: Ensure that HTTPS url is used with uri

(CKV2_ANSIBLE_1)

Source: MCP tools

key: raft_leader
when:
- ha_status_query.json is defined
- ha_status_query.json.nodes is defined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the OpenBao response key Nodes.

OpenBao serialises the HA member list as Nodes. The lowercase lookup is always undefined, so no controller enters raft_leader and the following assertion fails during multi-node recovery. Change both .json.nodes references to .json.Nodes. (openbao.org)

Source: MCP tools

environment:
https_proxy: ""
run_once: true
delegate_to: "{{ groups['controllers'][raft_leader_index | int] }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Send the first unseal request to the selected leader.

delegate_to runs the role on the selected controller, but vault_api_addr still resolves through the original run_once host. inventory_hostname does not change during delegation. If the leader is not the first controller, this task can send the first unseal request to a non-leader. Set vault_api_addr to https://{{ raft_leader_address }}:8200. (docs.ansible.com)

Source: MCP tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-review PR is waiting for a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant