In the snippet below, Am I right that elastic serach would be restarted 3 times assuming each action is performed?
Is there a way to collapse this into just one restart?
Say some way to set a flag for each action if the action is executed, and the at the end run a conditional to check if the flag >1 and then run the restart handler?
-
name: elasticsearch | write java server wrapper from template, restart ES
action: template src=templates/elasticsearch_service_wrapper.j2 dest=${deploy_base}/elasticsearch-${elasticsearch.version}/bin/service/elasticsearch mode=0755
tags: -
configuration
notify: -
Restart elasticsearch
-
name: elasticsearch | Install config from templates, then restart ES
action: template src=templates/$item dest=${deploy_base}/elasticsearch-${elasticsearch.version}/config/$item mode=0644 owner=root group=root
with_items: -
logging.yml
-
elasticsearch.yml
tags: -
configuration
notify: -
Restart elasticsearch
-
name: elasticsearch | Install upstart start script (conf) from templates, then restart ES
action: template src=templates/elasticsearch.conf.initd.j2 dest=/etc/init/elasticsearch.conf
notify: -
Restart elasticsearch
Thanks!