ansible-role-elasticsearch/tasks/elasticsearch.yml
David Reagan 8393b86a27 Added support for optionally creating the elasticsearch user and group before installing elasticsearch.
Renamed vars, set the tasks to use the es_user and es_group vars in elasticsearch-optional-user.yml. Modifed README.md to list the es_user_id and es_group_id vars, made note that both vars are required if they are used. Removed the commented out instances of the vars in defaults/main.yml.

Added es_user, es_group, es_user_id, es_group_id vars to config testing.

Made conditionals use explicit 'is defined' test.

Add tests for es_user_id and es_group_id.

Update defaults/main.yml and test/integration/config.yml to match master plus test config additions.
2016-04-13 09:42:12 -07:00

25 lines
1.1 KiB
YAML

---
- set_fact: instance_default_file={{default_file | dirname}}/{{es_instance_name}}_{{default_file | basename}}
- set_fact: instance_init_script={{init_script | dirname }}/{{es_instance_name}}_{{init_script | basename}}
- set_fact: conf_dir={{ es_conf_dir }}/{{es_instance_name}}
- set_fact: plugin_dir={{ es_plugin_dir }}/{{es_instance_name}}
- set_fact: m_lock_enabled={{ es_config['bootstrap.mlockall'] is defined and es_config['bootstrap.mlockall'] == True }}
- debug: msg="Node configuration {{ es_config }} "
- name: Include optional user and group creation.
when: (es_user_id is defined) and (es_group_id is defined)
include: elasticsearch-optional-user.yml
#- name: Include specific Elasticsearch
# include: "elasticsearch-{{ansible_os_family}}.yml"
#Install OS specific elasticsearch - this can be abbreviated in version 2.0.0
- name: Include specific Elasticsearch
include: elasticsearch-Debian.yml
when: ansible_os_family == 'Debian'
- name: Include specific Elasticsearch
include: elasticsearch-RedHat.yml
when: ansible_os_family == 'RedHat'