Skip to content

Restart Kibana before waiting for it and leave a disabled Kibana alone - #565

Merged
afeefghannam89 merged 2 commits into
mainfrom
kibana-restart
Oct 26, 2026
Merged

afeefghannam89 merged 2 commits into
mainfrom
kibana-restart

Conversation

@afeefghannam89

Copy link
Copy Markdown
Member

Configure Kibana, the package tasks and the certificate copies notify Restart Kibana, but the handler ran at the end of the play. The wait tasks ran before it, against the old process, so after a change nothing waited for the restarted Kibana and the next play, for example the Beats setup loading its dashboards, could find it down.

The role now runs the notified handlers right after Start Kibana with meta: flush_handlers, like the elasticsearch role does in elasticsearch-security.yml, and the waits see the new process. After a fresh start the handler still skips the restart. The flush and the wait block carry the certificate tags, so a run with --tags renew_kibana_cert waits as well.

With kibana_enable: false the handler restarted Kibana anyway, and the wait block still waited for it, up to 300 seconds when Kibana is not running. Both check kibana_enable now.

A run with --tags renew_kibana_cert, renew_ca or certificates failed with Invalid password or PKCS12 data when elasticstack_cert_pass is set. The task that copies it into kibana_tls_key_passphrase had no tags, so the certificate was read with the default PleaseChangeMe. As CONTRIBUTING.md asks, the set_fact tasks of the role that only build variables and cannot fail are tagged always now. Two are not: the package name needs elasticstack_versionseparator from the OS vars, which a run with --tags does not load, and the expiration days read a registered result.

Renewing the certificate also failed on a macOS control node. The backup of the temporary certificate on the control node was made as root with the group root, which macOS does not have. That block runs with become: false now, as the user who runs Ansible, without owner and group.

Tested on a Vagrant setup with three Elasticsearch nodes, Kibana and Logstash on Ubuntu 22.04, run from macOS: a config change restarts Kibana before the waits and the Auditbeat setup right after it succeeds, with kibana_enable: false neither restart nor wait runs, --tags renew_kibana_cert renews the certificate, restarts and waits, and a following run changes nothing.

Closes #563
Closes #484

@afeefghannam89
afeefghannam89 merged commit 11f5988 into main Oct 26, 2026
8 checks passed
@afeefghannam89
afeefghannam89 deleted the kibana-restart branch October 26, 2026 05:59
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.

[Bug]: Kibana role waits for Kibana before the restart handler runs [Bug]: Kibana restart handler ignores kibana_enable

1 participant