Merged
Conversation
d21ebf1 to
14d4c2f
Compare
This was referenced Mar 1, 2026
ffb2cb3 to
5da7a1f
Compare
When a service fails to start (bad config, missing certs, etc.), the roles now detect the failure within seconds and surface the actual error from journalctl instead of waiting for a blind port timeout. Each role's restart handler delegates to a restart_and_verify task file that wraps the restart in a block/rescue — if the service module fails or the service dies shortly after, the rescue collects the last 50 journal lines and fails with a clear diagnostic message. The ES and Kibana port waits are replaced with a smarter loop that checks both service health and port availability on each iteration, failing fast with diagnostics if the service dies mid-wait. Includes an elasticsearch_diagnostics molecule scenario that validates both the transparent happy path and the fast-failure path by injecting a bogus setting and asserting that the failure message contains log output.
The hand-rolled integration test suite targets specific Proxmox infrastructure and shouldn't be tracked in the repo.
Kibana opens port 5601 during its Preboot phase (~8 seconds after start) but takes 1-2 minutes to serve HTTP. Port-based wait_for checks pass during Preboot, leaving Kibana unable to serve requests when subsequent tasks or verify scripts run. Changed all three Kibana wait locations to check for HTTP 200/401 on /api/status instead of using ss/wait_for on the port: - roles/kibana/tasks/main.yml (smart watchdog) - roles/kibana/tasks/restart_and_verify_kibana.yml (handler verify) - roles/elasticsearch/handlers/restart_kibana.yml (ES cert handler) The ES role's restart_kibana handler also gets full diagnostics: if Kibana fails to start after the cert restart, the handler collects journalctl output and fails with an actionable message instead of silently leaving Kibana down.
5da7a1f to
ac6f33b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a service fails to start — bad config, missing certs, invalid heap, whatever — the roles previously waited for a blind port timeout (600s for ES, 300s for Kibana) before giving a generic error. The actual cause was buried in the journal on the remote host.
Now every role's restart handler delegates to a
restart_and_verifytask file that wraps the restart in a block/rescue. If the service module fails or the service dies shortly after starting, the rescue collects the last 50 lines of journalctl output and fails immediately with the actual error message. The ES and Kibana port waits also got the same treatment — they now check both service health and port availability on each retry iteration, failing fast with diagnostics if the service dies mid-wait instead of burning through the full timeout.The
elasticsearch_diagnosticsmolecule scenario validates both paths: normal restart works transparently, and a deliberately bad config (bogus setting injected into elasticsearch.yml) triggers a fast failure whose error message includes the journal output. Runs on a single distro since it's testing generic systemd plumbing, not distro-specific behavior.Also fixes the KICS workflow's SARIF upload permission (needed
security-events: writeafter the blanketcontents: readaddition) and moves the upgrade test from push-to-main to a daily schedule so it no longer runs only after merge.