Merge "Prevent duplicate initial_master_nodes"

This commit is contained in:
Zuul 2020-06-05 10:37:13 +00:00 committed by Gerrit Code Review
commit 54c4fc077b
1 changed files with 3 additions and 3 deletions

View File

@ -64,19 +64,19 @@ master_nodes: |-
{% set nodes = [] %}
{% for node in groups['elastic'] %}
{% if (nodes | length) <= (elastic_master_node_count | int) %}
{% if (hostvars[node]['elasticsearch_node_master'] is defined) and (hostvars[node]['elasticsearch_node_master'] | bool) %}
{% if (hostvars[node]['elasticsearch_node_master'] is defined) and (hostvars[node]['elasticsearch_node_master'] | bool) and (node not in nodes) %}
{% set _ = nodes.append(node) %}
{% endif %}
{% endif %}
{% endfor %}
{% for node in groups['elastic'] %}
{% if (nodes | length) <= (elastic_master_node_count | int) %}
{% if (node in _master_nodes) %}
{% if (node in _master_nodes) and (node not in nodes) %}
{% set _ = nodes.append(node) %}
{% endif %}
{% endif %}
{% endfor %}
{{ nodes }}
{{ nodes | unique }}
master_node_count: "{{ master_nodes | length }}"
coordination_nodes: |-