Skip to content

Show more meaningful errormessages for API #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions roles/elasticsearch/tasks/elasticsearch-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@
changed_when: false
no_log: true
when: not elasticsearch_passwords_file.stat.exists | bool
until: es_cluster_status_bootstrap.stdout == "green"
retries: 5
delay: 10

- name: Fetch Elastic password
shell: grep "PASSWORD elastic" {{ elastic_initial_passwords }} | awk {' print $4 '}
Expand All @@ -580,6 +583,9 @@
no_log: true
ignore_errors: "{{ ansible_check_mode }}"
when: elasticsearch_passwords_file.stat.exists | bool
until: es_cluster_status.stdout == "green"
retries: 5
delay: 10

- name: Check for open port 9200/tcp
wait_for:
Expand All @@ -589,20 +595,6 @@
- renew_ca
- renew_es_cert

- name: Fail if cluster is not ready yet
fail:
msg: "Elasticsearch cluster is not ready (status: {{ es_cluster_status.stdout }} , yet. Please rerun again later."
when: es_cluster_status.stdout is defined and es_cluster_status.stdout != "green" and groups['elasticsearch'] | length > 1
tags:
- notest

- name: Fail if cluster is not ready yet (bootstrap password)
fail:
msg: "Elasticsearch cluster is not ready (status: {{ es_cluster_status_bootstrap.stdout }}), yet. Please rerun again later."
when: es_cluster_status_bootstrap.stdout is defined and es_cluster_status_bootstrap.stdout != "green" and groups['elasticsearch'] | length > 1
tags:
- notest

- name: Create initial passwords
shell: >
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto -b >
Expand Down