Kibana: move the optimize dir on /var if /usr is read-only
This commit is contained in:
parent
be0fa9176b
commit
22dac714f1
6
kibana/handlers/main.yml
Normal file
6
kibana/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: restart kibana
|
||||||
|
systemd:
|
||||||
|
name: kibana
|
||||||
|
state: restarted
|
|
@ -28,3 +28,26 @@
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
|
- name: Get mount options for /usr partition
|
||||||
|
shell: "mount | grep 'on /usr type'"
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
|
register: mount
|
||||||
|
changed_when: False
|
||||||
|
failed_when: False
|
||||||
|
when: not ansible_check_mode
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Remount /usr as writable
|
||||||
|
command: "mount -o remount,rw /usr"
|
||||||
|
|
||||||
|
- name: Move kibana optimize directory
|
||||||
|
shell: "mv /usr/share/kibana/optimize /var/lib/kibana/optimize && ln -s /var/lib/kibana/optimize /usr/share/kibana/optimize"
|
||||||
|
args:
|
||||||
|
creates: /var/lib/kibana/optimize
|
||||||
|
notify: restart kibana
|
||||||
|
|
||||||
|
- name: Remount /usr as read-only
|
||||||
|
command: "mount -o remount /usr"
|
||||||
|
when: mount.rc == 0 and not mount.stdout_lines.0 | search("rw")
|
||||||
|
|
13
kibana/tasks/remount_usr_rw.yml
Normal file
13
kibana/tasks/remount_usr_rw.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
- name: Get mount options for partitions
|
||||||
|
shell: "mount | grep 'on /usr type'"
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
|
register: mount
|
||||||
|
changed_when: False
|
||||||
|
failed_when: False
|
||||||
|
when: not ansible_check_mode
|
||||||
|
|
||||||
|
- name: Remount /usr if it is a partition and it is not mounted in rw
|
||||||
|
command: "mount -o remount,rw /usr"
|
||||||
|
when: mount.rc == 0 and not mount.stdout_lines.0 | search("rw")
|
Loading…
Reference in a new issue