From f2750efbae92a5dd06794a70299eb4b190abef45 Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Tue, 26 Oct 2021 21:40:24 +0400 Subject: [PATCH] verify cluster status (#8) Signed-off-by: saravanan palanisamy --- roles/centos7/dashboards/tasks/etchosts.yml | 2 +- roles/centos7/opensearch/tasks/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/centos7/dashboards/tasks/etchosts.yml b/roles/centos7/dashboards/tasks/etchosts.yml index b9b42b2..e7b614f 100644 --- a/roles/centos7/dashboards/tasks/etchosts.yml +++ b/roles/centos7/dashboards/tasks/etchosts.yml @@ -3,7 +3,7 @@ blockinfile: dest: /etc/hosts block: |- - {% for item in groups['os-cluster'] %} + {% for item in groups['dashboards'] %} {{ hostvars[item]['ip'] }} {{ item }}.{{ domain_name }} {{ item }} {% endfor %} state: present diff --git a/roles/centos7/opensearch/tasks/main.yml b/roles/centos7/opensearch/tasks/main.yml index db155dd..1b9c8b7 100644 --- a/roles/centos7/opensearch/tasks/main.yml +++ b/roles/centos7/opensearch/tasks/main.yml @@ -40,3 +40,4 @@ - name: Show the opensearch status debug: msg: "{{ os_status.stdout }}" + failed_when: "'number_of_nodes' not in os_status.stdout"