Use a template to write override.conf file (#697)

This commit is contained in:
Alberto Martínez Ballesteros 2020-05-27 14:56:03 +02:00 committed by GitHub
parent 16fad55bfe
commit 4420df6927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View file

@ -60,7 +60,7 @@
notify: restart elasticsearch
#Copy the systemd specific file if systemd is installed
- when: use_system_d and m_lock_enabled
- when: use_system_d and (m_lock_enabled or es_max_open_files is defined)
become: yes
block:
- name: Make sure destination dir exists
@ -70,12 +70,13 @@
mode: "755"
- name: Copy specific ElasticSearch Systemd config file
ini_file:
path: "{{ sysd_config_file }}"
section: Service
option: LimitMEMLOCK
value: infinity
template:
src: "override.conf.j2"
dest: "{{ sysd_config_file }}"
owner: root
group: "{{ es_group }}"
mode: "644"
force: yes
notify:
- reload systemd configuration
- restart elasticsearch