Ludovic Poujol
69a9cb9591
Some checks reported errors
continuous-integration/drone/push Build was killed
Note : Files in that folder require the ".options" prefix
Fixes a2f73bb7df
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
---
|
|
|
|
- name: Check if /tmp is noexec
|
|
shell: "cat /etc/fstab | grep -E \" +/tmp\" | grep noexec"
|
|
register: fstab_tmp_noexec
|
|
failed_when: False
|
|
changed_when: False
|
|
check_mode: no
|
|
|
|
- name: Tmpdir is moved to custom path
|
|
block:
|
|
- set_fact:
|
|
_elasticsearch_custom_tmpdir: "{{ elasticsearch_custom_tmpdir | default(elasticsearch_default_tmpdir, True) | mandatory }}"
|
|
tags:
|
|
- elasticsearch
|
|
|
|
- name: "Create {{ _elasticsearch_custom_tmpdir }}"
|
|
file:
|
|
path: "{{ _elasticsearch_custom_tmpdir }}"
|
|
owner: elasticsearch
|
|
group: elasticsearch
|
|
mode: "0755"
|
|
state: directory
|
|
tags:
|
|
- elasticsearch
|
|
|
|
- name: change JVM tmpdir (< 6.x)
|
|
lineinfile:
|
|
dest: /etc/elasticsearch/jvm.options.d/evolinux.options
|
|
line: "-Djava.io.tmpdir={{ _elasticsearch_custom_tmpdir }}"
|
|
regexp: "^-Djava.io.tmpdir="
|
|
create: yes
|
|
owner: root
|
|
group: elasticsearch
|
|
mode: 0640
|
|
notify:
|
|
- restart elasticsearch
|
|
tags:
|
|
- elasticsearch
|
|
when: elastic_stack_version is version('6', '<')
|
|
|
|
- name: check if ES_TMPDIR is available (>= 6.x)
|
|
lineinfile:
|
|
dest: /etc/default/elasticsearch
|
|
line: "ES_TMPDIR={{ _elasticsearch_custom_tmpdir }}"
|
|
regexp: "^ES_TMPDIR="
|
|
insertafter: "JAVA_HOME"
|
|
notify:
|
|
- restart elasticsearch
|
|
tags:
|
|
- elasticsearch
|
|
when: elastic_stack_version is version('6', '>=')
|
|
|
|
# Note : Should not do any changes as -Djava.io.tmpdir=${ES_TMPDIR} is already here in the default config.
|
|
- name: change JVM tmpdir (>= 6.x)
|
|
lineinfile:
|
|
dest: /etc/elasticsearch/jvm.options
|
|
line: "-Djava.io.tmpdir=${ES_TMPDIR}"
|
|
regexp: "^-Djava.io.tmpdir="
|
|
insertafter: "## JVM configuration"
|
|
notify:
|
|
- restart elasticsearch
|
|
tags:
|
|
- elasticsearch
|
|
when: elastic_stack_version is version('6', '>=')
|
|
when: (elasticsearch_custom_tmpdir is not none and elasticsearch_custom_tmpdir | length > 0) or fstab_tmp_noexec.rc == 0
|