openstack-ansible-ops/elk_metrics_7x/roles/elastic_ilm/tasks/main.yml
Duncan Martin Walker 1214e42b85 Explicitly use Elasticsearch data node for ILM index update
When installing/configuring beats, it may be the case that elastic-logstash
nodes are not running Elasticsearch directly, and so can't update the ILM
config accordingly. This commit explicitly delegates the ILM config update
to an elasticsearch data node, in order that this will always be possible.
As Elasticsearch and logstash are by default installed together, the default
behaviour is unchanged.

Change-Id: I6833585b9a02eddc3c9a1179e487cdeaefa30ac2
2020-02-05 17:05:16 +00:00

13 lines
521 B
YAML

---
- include_tasks: "elastic_ilm_policy_template.yml"
when: ilm_policy_file_location is defined and ilm_policy_filename is defined and ilm_policy is defined
- block:
- name: Update policy and template when not upgrading
include_tasks: "elastic_ilm_update_policy.yml"
delegate_to: "{{ elasticsearch_data_node_details[0] | regex_replace(':' ~ elastic_port,'') }}"
environment:
no_proxy: "{{ elastic_beat_no_proxy }},127.0.0.1"
run_once: True
when: (elk_package_state | default('present')) != "latest"