From d23feddedec43a1ae37b956ec66241c62249fb7d Mon Sep 17 00:00:00 2001 From: zenidd Date: Mon, 9 Nov 2020 17:57:12 +0100 Subject: [PATCH] Refactor test conditions --- roles/opendistro/opendistro-elasticsearch/tasks/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/opendistro/opendistro-elasticsearch/tasks/main.yml b/roles/opendistro/opendistro-elasticsearch/tasks/main.yml index 82515328..998cdd32 100644 --- a/roles/opendistro/opendistro-elasticsearch/tasks/main.yml +++ b/roles/opendistro/opendistro-elasticsearch/tasks/main.yml @@ -64,13 +64,12 @@ return_content: yes timeout: 4 register: _result - until: ( _result.json is defined) and (_result.json.status == "green" or _result.json.status == "yellow" ) + until: ( _result.json is defined) and (_result.json.status == "green" or ( _result.json.status == "yellow" and single_node ) ) retries: 24 delay: 5 tags: debug when: - hostvars[inventory_hostname]['private_ip'] is not defined or not hostvars[inventory_hostname]['private_ip'] - - single_node == false - name: Wait for Elasticsearch API (Private IP) uri: @@ -82,13 +81,12 @@ return_content: yes timeout: 4 register: _result - until: ( _result.json is defined) and (_result.json.status == "green" or _result.json.status == "yellow" ) + until: ( _result.json is defined) and (_result.json.status == "green" or ( _result.json.status == "yellow" and single_node ) ) retries: 24 delay: 5 tags: debug when: - hostvars[inventory_hostname]['private_ip'] is defined and hostvars[inventory_hostname]['private_ip'] - - single_node == false - import_tasks: "RMRedHat.yml" when: ansible_os_family == "RedHat"