Move restart to main from handler

This commit is contained in:
Dale McDiarmid 2017-01-17 14:42:21 +00:00
parent 7b32a17d59
commit 914cb7867c
5 changed files with 7 additions and 11 deletions

View file

@ -1,8 +0,0 @@
---
- name: Restart Elasticsearch
service: name={{instance_init_script | basename}} state=restarted enabled=yes
when: es_restart_on_change and es_start_service and ((plugin_installed is defined and plugin_installed.changed) or (config_updated is defined and config_updated.changed) or (xpack_state.changed) or (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))
- name: Wait for elasticsearch to startup
wait_for: host={{es_api_host}} port={{es_api_port}} delay=5 connect_timeout=1

View file

@ -3,7 +3,8 @@
# Restart service and ensure it is enabled
- name: restart elasticsearch
include: ./handlers/elasticsearch-restart.yml
service: name={{instance_init_script | basename}} state=restarted enabled=yes
when: es_restart_on_change and es_start_service and ((plugin_installed is defined and plugin_installed.changed) or (config_updated is defined and config_updated.changed) or (xpack_state.changed) or (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))
# All security specific actions should go in here
- name: activate-security

View file

@ -41,4 +41,8 @@
when: es_templates
tags:
- templates
- meta: flush_handlers
- name: Wait for elasticsearch to startup
wait_for: host={{es_api_host}} port={{es_api_port}} delay=5 connect_timeout=1

View file

@ -17,7 +17,7 @@ LOG_DIR={{log_dir}}
# Elasticsearch PID directory
PID_DIR={{pid_dir}}
ES_JVM_OPTIONS={{conf_dir}}/jvm.options
#ES_JVM_OPTIONS={{conf_dir}}/jvm.options
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
#ES_RESTART_ON_UPGRADE=true

View file

@ -33,7 +33,6 @@ ExecStart={{es_home}}/bin/elasticsearch \
# stores its logs in /var/log/elasticsearch and does not use
# journalctl by default. If you also want to enable journalctl
# logging, you can simply remove the "quiet" option from ExecStart.
StandardOutput=journal
StandardError=inherit