From 9197f2fbcd85073682c3fb7ef90b33936aca5077 Mon Sep 17 00:00:00 2001 From: janderson2 Date: Mon, 15 May 2017 15:15:17 +0100 Subject: [PATCH] Ensure elasticsearch is always started Ensure that elasticsearch is started/running even if non of the handlers are called. Previously, if the host was provisioned correctly, but elasticsearch was not running the role would not attempt to start it. This can happen if elasticsearch was killed, or if the previous ansible run failed prior to running the handlers. --- tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 4648f8d..5cd4fc4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,6 +44,9 @@ - meta: flush_handlers +- name: Make sure elasticsearch is started + service: name={{instance_init_script | basename}} state=started enabled=yes + - name: Wait for elasticsearch to startup wait_for: host={{es_api_host}} port={{es_api_port}} delay=5 connect_timeout=1