2015-10-22 19:09:53 +01:00
|
|
|
---
|
|
|
|
|
# Configure Elasticsearch Node
|
2015-11-27 19:39:47 +00:00
|
|
|
|
2019-09-18 10:57:07 +02:00
|
|
|
#Create conf directory
|
|
|
|
|
- name: Create Configuration Directory
|
|
|
|
|
become: yes
|
|
|
|
|
file: path={{ es_conf_dir }} state=directory owner=root group={{ es_group }} mode=2750
|
|
|
|
|
|
|
|
|
|
#Create pid directory
|
|
|
|
|
- name: Create PID Directory
|
|
|
|
|
become: yes
|
|
|
|
|
file: path={{ es_pid_dir }} state=directory owner={{ es_user }} group={{ es_group }} mode=0755
|
|
|
|
|
|
2015-11-27 18:12:59 +00:00
|
|
|
#Create required directories
|
2019-09-18 10:57:07 +02:00
|
|
|
- name: Create Others Directories
|
2017-05-12 13:31:50 -07:00
|
|
|
become: yes
|
2019-09-18 10:57:07 +02:00
|
|
|
file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }} mode=2750
|
2016-03-18 19:30:11 +00:00
|
|
|
with_items:
|
2019-06-03 14:18:09 +02:00
|
|
|
- "{{ es_log_dir }}"
|
|
|
|
|
- "{{ es_data_dirs }}"
|
2015-12-13 22:46:50 +00:00
|
|
|
|
2015-11-27 18:12:59 +00:00
|
|
|
#Copy the config template
|
|
|
|
|
- name: Copy Configuration File
|
2017-05-12 13:31:50 -07:00
|
|
|
become: yes
|
2019-09-18 10:57:07 +02:00
|
|
|
template: src=elasticsearch.yml.j2 dest={{ es_conf_dir }}/elasticsearch.yml owner=root group={{ es_group }} mode=0660 force=yes
|
2017-08-20 10:30:39 -04:00
|
|
|
register: system_change
|
2015-11-27 18:12:59 +00:00
|
|
|
notify: restart elasticsearch
|
2015-10-22 19:09:53 +01:00
|
|
|
|
2019-06-03 14:18:09 +02:00
|
|
|
#Copy the default file
|
|
|
|
|
- name: Copy Default File
|
2017-05-12 13:31:50 -07:00
|
|
|
become: yes
|
2019-09-18 10:57:07 +02:00
|
|
|
template: src=elasticsearch.j2 dest={{ default_file }} owner=root group={{ es_group }} mode=0660 force=yes
|
2015-11-27 18:12:59 +00:00
|
|
|
notify: restart elasticsearch
|
2015-10-22 19:09:53 +01:00
|
|
|
|
2019-07-22 12:28:40 +02:00
|
|
|
#Copy the systemd specific file if systemd is installed
|
2019-07-22 14:42:26 +02:00
|
|
|
- when: use_system_d and m_lock_enabled
|
2019-07-22 15:19:00 +02:00
|
|
|
become: yes
|
2019-07-22 14:42:26 +02:00
|
|
|
block:
|
|
|
|
|
- name: Make sure destination dir exists
|
2019-07-22 15:19:00 +02:00
|
|
|
file: path={{ sysd_config_file | dirname }} state=directory mode=0755
|
2019-09-18 10:57:07 +02:00
|
|
|
|
2019-07-22 15:19:00 +02:00
|
|
|
- name: Copy specific ElasticSearch Systemd config file
|
|
|
|
|
ini_file: path={{ sysd_config_file }} section=Service option=LimitMEMLOCK value=infinity mode=0644
|
2019-07-22 14:42:26 +02:00
|
|
|
notify:
|
|
|
|
|
- reload systemd configuration
|
|
|
|
|
- restart elasticsearch
|
2019-07-22 12:28:40 +02:00
|
|
|
|
2015-11-26 14:19:25 +00:00
|
|
|
#Copy the logging.yml
|
2019-06-03 14:18:09 +02:00
|
|
|
- name: Copy log4j2.properties File
|
2017-05-12 13:31:50 -07:00
|
|
|
become: yes
|
2019-09-18 10:57:07 +02:00
|
|
|
template: src={{ es_config_log4j2 }} dest={{ es_conf_dir }}/log4j2.properties owner=root group={{ es_group }} mode=0660 force=yes
|
2016-11-03 15:24:17 +01:00
|
|
|
notify: restart elasticsearch
|
|
|
|
|
|
2019-06-03 14:18:09 +02:00
|
|
|
- name: Copy jvm.options File
|
2017-05-12 13:31:50 -07:00
|
|
|
become: yes
|
2019-09-18 10:57:07 +02:00
|
|
|
template: src=jvm.options.j2 dest={{ es_conf_dir }}/jvm.options owner=root group={{ es_group }} mode=0660 force=yes
|
2016-11-03 15:24:17 +01:00
|
|
|
notify: restart elasticsearch
|