Use a template to write override.conf file (#697)
This commit is contained in:
parent
16fad55bfe
commit
4420df6927
2 changed files with 14 additions and 6 deletions
|
|
@ -60,7 +60,7 @@
|
||||||
notify: restart elasticsearch
|
notify: restart elasticsearch
|
||||||
|
|
||||||
#Copy the systemd specific file if systemd is installed
|
#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
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Make sure destination dir exists
|
- name: Make sure destination dir exists
|
||||||
|
|
@ -70,12 +70,13 @@
|
||||||
mode: "755"
|
mode: "755"
|
||||||
|
|
||||||
- name: Copy specific ElasticSearch Systemd config file
|
- name: Copy specific ElasticSearch Systemd config file
|
||||||
ini_file:
|
template:
|
||||||
path: "{{ sysd_config_file }}"
|
src: "override.conf.j2"
|
||||||
section: Service
|
dest: "{{ sysd_config_file }}"
|
||||||
option: LimitMEMLOCK
|
owner: root
|
||||||
value: infinity
|
group: "{{ es_group }}"
|
||||||
mode: "644"
|
mode: "644"
|
||||||
|
force: yes
|
||||||
notify:
|
notify:
|
||||||
- reload systemd configuration
|
- reload systemd configuration
|
||||||
- restart elasticsearch
|
- restart elasticsearch
|
||||||
|
|
|
||||||
7
templates/override.conf.j2
Normal file
7
templates/override.conf.j2
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[Service]
|
||||||
|
{% if m_lock_enabled %}
|
||||||
|
LimitMEMLOCK = infinity
|
||||||
|
{% endif %}
|
||||||
|
{% if es_max_open_files is defined %}
|
||||||
|
LimitNOFILE = {{ es_max_open_files }}
|
||||||
|
{% endif %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue