From 4aee0098cefe3ea26d5835c1759f3b4513fa65f1 Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Thu, 24 Dec 2015 13:21:18 +0000 Subject: [PATCH 1/2] Changes to restart correctly on multi node install --- README.md | 1 + tasks/elasticsearch-templates.yml | 3 +-- tasks/main.yml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f68e289..1be1b5e 100644 --- a/README.md +++ b/README.md @@ -198,3 +198,4 @@ all supported platforms. * The role aims to be idempotent. Running the role multiple times, with no changes, should result in no state change on the server. If the configuration is changed, these will be applied and Elasticsearch restarted where required. * Systemd is used for Ubuntu versions >= 15, Debian >=8, Centos >=7. All other versions use init for service scripts. + diff --git a/tasks/elasticsearch-templates.yml b/tasks/elasticsearch-templates.yml index 3033e73..1bcfd71 100644 --- a/tasks/elasticsearch-templates.yml +++ b/tasks/elasticsearch-templates.yml @@ -1,6 +1,5 @@ --- -#TODO: How to handle in multi node -# 1. Template directory needs to be specifiable + - name: Copy templates to elasticsearch copy: src=templates dest=/etc/elasticsearch/ owner={{ es_user }} group={{ es_group }} diff --git a/tasks/main.yml b/tasks/main.yml index 9fbd329..e835795 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -10,4 +10,5 @@ - include: elasticsearch-scripts.yml when: es_scripts - include: elasticsearch-templates.yml - when: es_templates \ No newline at end of file + when: es_templates +- meta: flush_handlers \ No newline at end of file From 731d4b20fe2ad37b1062fce22f253e76123e70f4 Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Fri, 15 Jan 2016 22:05:05 +0000 Subject: [PATCH 2/2] Fix if plugins are not defined --- handlers/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index cec97f9..45f8a83 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,4 @@ - name: restart elasticsearch service: name={{instance_init_script | basename}} state=restarted enabled=yes - when: es_start_service and (not elasticsearch_started.changed or plugin_installed.changed) \ No newline at end of file + when: es_start_service and (not elasticsearch_started.changed or (plugin_installed is defined and plugin_installed.changed)) \ No newline at end of file