Jérémy Lecour
8920ff1ee4
There is also the "check_mode: no", but commented, for when we switch to Ansible 2.2
33 lines
985 B
YAML
33 lines
985 B
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 (for migration to Ansible 2.2)
|
|
always_run: yes
|
|
|
|
- block:
|
|
- name: "Create {{ elasticsearch_custom_tmpdir or elasticsearch_default_tmpdir | mandatory }}"
|
|
file:
|
|
path: "{{ elasticsearch_custom_tmpdir or elasticsearch_default_tmpdir | mandatory }}"
|
|
owner: elasticsearch
|
|
group: elasticsearch
|
|
mode: "755"
|
|
state: directory
|
|
tags:
|
|
- elasticsearch
|
|
|
|
- name: change JVM tmpdir
|
|
lineinfile:
|
|
dest: /etc/elasticsearch/jvm.options
|
|
line: "-Djava.io.tmpdir={{ elasticsearch_custom_tmpdir or elasticsearch_default_tmpdir | mandatory }}"
|
|
regexp: "^-Djava.io.tmpdir="
|
|
insertafter: "## JVM configuration"
|
|
notify:
|
|
- restart elasticsearch
|
|
tags:
|
|
- elasticsearch
|
|
when: elasticsearch_custom_tmpdir or fstab_tmp_noexec|success
|