Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
---
|
|
|
|
- name: Check if /tmp is noexec
|
|
ansible.builtin.shell:
|
|
cmd: "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:
|
|
- ansible.builtin.set_fact:
|
|
_elasticsearch_custom_tmpdir: "{{ elasticsearch_custom_tmpdir | default(elasticsearch_default_tmpdir, True) | mandatory }}"
|
|
tags:
|
|
- elasticsearch
|
|
|
|
- name: "Create {{ _elasticsearch_custom_tmpdir }}"
|
|
ansible.builtin.file:
|
|
path: "{{ _elasticsearch_custom_tmpdir }}"
|
|
owner: elasticsearch
|
|
group: elasticsearch
|
|
mode: "0755"
|
|
state: directory
|
|
tags:
|
|
- elasticsearch
|
|
|
|
- name: change JVM tmpdir (< 6.x)
|
|
ansible.builtin.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)
|
|
ansible.builtin.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)
|
|
ansible.builtin.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
|