Skip to content

feat(kibana): add kibana_public_base_url to override server.publicBaseUrl#159

Open
Oddly wants to merge 1 commit into
mainfrom
feat/kibana-public-base-url
Open

feat(kibana): add kibana_public_base_url to override server.publicBaseUrl#159
Oddly wants to merge 1 commit into
mainfrom
feat/kibana-public-base-url

Conversation

@Oddly

@Oddly Oddly commented Jun 28, 2026

Copy link
Copy Markdown
Owner

The kibana role derives server.publicBaseUrl as <scheme>://<host>:<port>, which is incorrect when Kibana runs behind a reverse proxy on a different host/port (generated report and alerting links point at the node instead of the proxy).

This adds an optional kibana_public_base_url variable, used verbatim when set. The default is empty, preserving the current generated value, so there is no behaviour change for existing users.

Coverage added to the kibana_custom molecule scenario: it sets the override and asserts the verbatim value is rendered and the :5601 form is absent.

Summary by CodeRabbit

  • New Features

    • Added support for setting a custom public URL for Kibana.
    • The configured value is used as-is when provided, with a fallback to the automatically generated URL when left unset.
  • Bug Fixes

    • Improved Kibana configuration handling to avoid adding an unexpected port to custom public URLs.
    • Expanded verification to confirm the configured URL appears correctly in the generated setup.

…eUrl

The role derives server.publicBaseUrl as "<scheme>://<host>:<port>", which is
incorrect when Kibana runs behind a reverse proxy on a different host or port.
Add an optional kibana_public_base_url variable, used verbatim when set; an
empty default preserves the existing generated value. Covered by an assertion
in the kibana_custom molecule scenario.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5b5a6add-8d79-4350-a512-e4fbb7158b73

📥 Commits

Reviewing files that changed from the base of the PR and between 76f7a50 and 484d17e.

📒 Files selected for processing (4)
  • molecule/kibana_custom/converge.yml
  • molecule/kibana_custom/verify.yml
  • roles/kibana/defaults/main.yml
  • roles/kibana/templates/kibana.yml.j2

📝 Walkthrough

Walkthrough

Adds a kibana_public_base_url role variable that, when set, overrides server.publicBaseUrl in kibana.yml verbatim. The Jinja2 template gains a conditional to use the override or fall back to the computed URL. Molecule tests cover both the variable injection and the rendered output assertion.

Changes

kibana_public_base_url override support

Layer / File(s) Summary
Variable definition and template conditional
roles/kibana/defaults/main.yml, roles/kibana/templates/kibana.yml.j2
Adds kibana_public_base_url default variable (empty, with fallback docs) and replaces the unconditional server.publicBaseUrl assignment with a conditional that uses the override when non-empty.
Molecule converge and verify
molecule/kibana_custom/converge.yml, molecule/kibana_custom/verify.yml
Sets kibana_public_base_url: https://kibana.example.com in the converge playbook and adds assertions that kibana.yml contains the verbatim override and does not contain the port-suffixed form.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding kibana_public_base_url to override server.publicBaseUrl.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/kibana-public-base-url

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant