NETWAYS / NETWAYS/ansible-collection-elasticstack

[Bug]: Kibana-restart-on-ES-certificate handler checks the wrong host and is gated on full_stack

Open
#534 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component:elasticsearch component:kibana
Dominant language
Jinja
Stars
14
Forks
11
Avg merge
1d 47m
Merged PRs (30d)
6

Description

The handler "Restart kibana if available for elasticsearch certificates" (elasticsearch/handlers/main.yml) iterates the Kibana inventory group and delegates the restart per host — but restart_kibana.yml runs package_facts on the Elasticsearch host (no delegate_to) and then guards the restart with 'kibana' in ansible_facts.packages. So it checks the ES host's packages, not the Kibana host's. Effect: in a split deployment (Kibana on its own host) it never restarts the remote Kibana; it only fires when Kibana is co-located on the ES host.

Two fixes:

  • Correct the host mismatch (gather/check package facts on the Kibana host being restarted, or drop the check and rely on the group).
  • Drop the elasticstack_full_stack gate. It is redundant: the handler already guards on groups[elasticstack_kibana_group_name] | default([]) | length > 0, so with no Kibana group it is a no-op — in both full-stack and standalone. Removing it is therefore not breaking.

Also worth questioning: whether a Kibana restart is needed at all on an ES certificate change — with an unchanged CA, Kibana keeps trusting ES via the CA and reconnects on its own.

Bug fix → 1.0.0. Part of #531 (removes the full_stack meaning "(D) cross-host handler").

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with elasticsearch/handlers/main.yml and restart_kibana.yml, tracing which host runs package_facts and how the Kibana group and elasticstack_full_stack conditions interact. Verify the behavior for split Kibana and Elasticsearch deployments, then confirm the handler is a no-op without a Kibana group and decide whether certificate changes require a Kibana restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, elasticsearch
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.