ansible-role-elasticsearch/tasks/elasticsearch-config.yml
Julien Mailleret 6217e9485e
stop overriding log4j configuration
The log4j configuration template provided by this ansible role doesn't reflect current log4j configuration in elasticsearch 6.x and 7.x.
Also this template doesn't contain any variable so everything is hardcoded inside.
As we don't need to override any value inside, let's use standard elasticsearch log4j configuration file provided by elasticsearch package and stop overriding it with this role.
2019-11-26 23:31:59 +01:00

51 lines
1.7 KiB
YAML

---
# Configure Elasticsearch Node
#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
#Create required directories
- name: Create Others Directories
become: yes
file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }} mode=2750
with_items:
- "{{ es_log_dir }}"
- "{{ es_data_dirs }}"
#Copy the config template
- name: Copy Configuration File
become: yes
template: src=elasticsearch.yml.j2 dest={{ es_conf_dir }}/elasticsearch.yml owner=root group={{ es_group }} mode=0660 force=yes
register: system_change
notify: restart elasticsearch
#Copy the default file
- name: Copy Default File
become: yes
template: src=elasticsearch.j2 dest={{ default_file }} owner=root group={{ es_group }} mode=0660 force=yes
notify: restart elasticsearch
#Copy the systemd specific file if systemd is installed
- when: use_system_d and m_lock_enabled
become: yes
block:
- name: Make sure destination dir exists
file: path={{ sysd_config_file | dirname }} state=directory mode=0755
- name: Copy specific ElasticSearch Systemd config file
ini_file: path={{ sysd_config_file }} section=Service option=LimitMEMLOCK value=infinity mode=0644
notify:
- reload systemd configuration
- restart elasticsearch
- name: Copy jvm.options File
become: yes
template: src=jvm.options.j2 dest={{ es_conf_dir }}/jvm.options owner=root group={{ es_group }} mode=0660 force=yes
notify: restart elasticsearch