Skip to content

beats: resolve the output hosts once instead of in every template - #559

Open
afeefghannam89 wants to merge 3 commits into
mainfrom
beats_output_hosts
Open

afeefghannam89 wants to merge 3 commits into
mainfrom
beats_output_hosts

Conversation

@afeefghannam89

@afeefghannam89 afeefghannam89 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

The Beats templates worked out their own output hosts, nine times over, each with the same
elasticstack_full_stack branch. They now read beats_elasticsearch_hosts and
beats_logstash_hosts, set once in roles/beats/tasks/main.yml the way the kibana role does
it. A value the user sets wins. Otherwise, with elasticstack_full_stack true, the role fills
them from the inventory groups.

Two things that were not possible before:

  • different hosts per output type, so Filebeat can go to Logstash while Metricbeat goes to
    Elasticsearch
  • setting the hosts at all while elasticstack_full_stack is true

beats_target_hosts is removed. It fed both output types with one list and was ignored while
elasticstack_full_stack is true. With elasticstack_full_stack false, the two variables are
set directly, and the two Beats molecule scenarios now do that. Breaking, but the collection is
still 0.x.

The two set_fact tasks are tagged always, so every run has the two lists. The preflight
assert from #552 has the same tags as the configure tasks. It runs whenever a configuration gets
written and stops the run if a list is empty. A --tags certificates run writes no
configuration, so the assert does not run there. The rule behind this is now in
CONTRIBUTING.md.

Closes #557

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.

[Feature]: Separate Beats output hosts per output type and make them overridable

1 participant