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

View File

@ -64,19 +64,19 @@ master_nodes: |-
{% set nodes = [] %} {% set nodes = [] %}
{% for node in groups['elastic'] %} {% for node in groups['elastic'] %}
{% if (nodes | length) <= (elastic_master_node_count | int) %} {% 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) %} {% set _ = nodes.append(node) %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for node in groups['elastic'] %} {% for node in groups['elastic'] %}
{% if (nodes | length) <= (elastic_master_node_count | int) %} {% 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) %} {% set _ = nodes.append(node) %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ nodes }} {{ nodes | unique }}
master_node_count: "{{ master_nodes | length }}" master_node_count: "{{ master_nodes | length }}"
coordination_nodes: |- coordination_nodes: |-