diff --git a/roles/elasticsearch/tasks/elasticsearch-security.yml b/roles/elasticsearch/tasks/elasticsearch-security.yml index 52b0b77..9ec3f83 100644 --- a/roles/elasticsearch/tasks/elasticsearch-security.yml +++ b/roles/elasticsearch/tasks/elasticsearch-security.yml @@ -648,15 +648,7 @@ when: elasticsearch_http_security - name: elasticsearch-security | Runtime cluster setup (requires running Elasticsearch) - # Runtime cluster setup uses the bootstrap password to seed the elastic user, - # built-in user passwords, etc. on a fresh cluster. When joining an existing - # cluster (elasticsearch_cluster_set_up: true) those are already part of the - # replicated cluster state, the bootstrap password is no longer accepted, - # and this whole block fails with "Bootstrap password authentication failed - # and this is not the CA host". See issue #148. - when: - - not ansible_check_mode - - not elasticsearch_cluster_set_up | bool + when: not ansible_check_mode block: - name: elasticsearch-security | Check for API with bootstrap password ansible.builtin.uri: diff --git a/roles/elasticsearch/tasks/main.yml b/roles/elasticsearch/tasks/main.yml index 8339e91..a59ba41 100644 --- a/roles/elasticsearch/tasks/main.yml +++ b/roles/elasticsearch/tasks/main.yml @@ -125,17 +125,11 @@ elasticsearch_count_of_master_nodes: >- {{ ansible_play_hosts_all | intersect(groups['elasticsearch_role_master'] | default([])) | length }} - # The odd-master-count rule is required for a fresh-bootstrapped cluster - # to have a stable initial quorum. When joining an existing cluster - # (elasticsearch_cluster_set_up: true) the cluster already has its own - # master-eligible quorum independent of how many new nodes are added in - # this play, so the check is irrelevant and would block legitimate joins. - name: Check count of master nodes ansible.builtin.fail: msg: "There must be an odd count of master nodes. You have {{ elasticsearch_count_of_master_nodes }}" when: - elasticsearch_count_of_master_nodes | int % 2 == 0 - - not elasticsearch_cluster_set_up | bool - name: End play in checks ansible.builtin.meta: end_host