ansible-role-elasticsearch/tasks/main.yml

63 lines
1.9 KiB
YAML
Raw Normal View History

2015-05-11 16:51:33 +02:00
---
- name: os-specific vars
include_vars: "{{ansible_os_family}}.yml"
tags:
- always
- name: check-set-parameters
include: elasticsearch-parameters.yml
tags:
- always
2015-05-11 16:51:33 +02:00
- include: java.yml
2016-07-20 13:51:14 +01:00
when: es_java_install
2016-04-26 11:45:11 -07:00
tags:
- java
- include: elasticsearch.yml
2016-04-26 11:45:11 -07:00
tags:
- install
2017-01-11 12:17:16 +00:00
- include: elasticsearch-config.yml
2016-04-26 11:45:11 -07:00
tags:
- config
2017-01-11 12:17:16 +00:00
2015-11-25 17:13:45 +00:00
- include: elasticsearch-scripts.yml
when: es_scripts
2016-04-26 11:45:11 -07:00
tags:
- scripts
2017-01-11 12:17:16 +00:00
- include: elasticsearch-plugins.yml
when: es_plugins is defined or es_plugins_reinstall
2016-04-26 11:45:11 -07:00
tags:
- plugins
2017-01-11 12:17:16 +00:00
#We always execute xpack as we may need to remove features
- include: xpack/elasticsearch-xpack.yml
2016-07-08 14:49:21 +01:00
tags:
- xpack
2017-01-11 12:17:16 +00:00
2016-07-20 13:51:14 +01:00
- meta: flush_handlers
2017-01-17 14:42:21 +00:00
2017-08-17 12:25:25 +01:00
#Templates done after restart - handled by flushing the handlers. e.g. suppose user removes security on a running node and doesn't specify es_api_basic_auth_username and es_api_basic_auth_password. The templates will subsequently not be removed if we don't wait for the node to restart.
- include: elasticsearch-template.yml
when: es_templates
2017-08-16 12:41:10 +01:00
tags:
- templates
- name: Make sure elasticsearch is started
service: name={{instance_init_script | basename}} state=started enabled=yes
when: es_start_service
2017-01-17 14:42:21 +00:00
- name: Wait for elasticsearch to startup
2017-03-15 16:12:22 -04:00
wait_for: host={{es_api_host}} port={{es_api_port}} delay=5 connect_timeout=1
when: es_restarted is defined and es_restarted.changed and es_start_service
2017-03-15 16:12:22 -04:00
- name: activate-license
include: ./xpack/security/elasticsearch-xpack-activation.yml
when: es_start_service and es_enable_xpack and es_xpack_license is defined and es_xpack_license != ''
2017-03-15 16:12:22 -04:00
#perform security actions here now elasticsearch is started
- include: ./xpack/security/elasticsearch-security-native.yml
when: es_start_service and (es_enable_xpack and '"security" in es_xpack_features') and ((es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined))