nagios-nrpe: remount /usr if needed
This commit is contained in:
parent
37ef790d57
commit
32e25e0e46
|
@ -25,6 +25,9 @@
|
||||||
state: directory
|
state: directory
|
||||||
notify: restart nagios-nrpe-server
|
notify: restart nagios-nrpe-server
|
||||||
|
|
||||||
|
- include: remount_usr_rw.yml
|
||||||
|
when: nagios_plugins_directory | search ("/usr")
|
||||||
|
|
||||||
- name: Nagios plugins are installed
|
- name: Nagios plugins are installed
|
||||||
copy:
|
copy:
|
||||||
src: plugins/
|
src: plugins/
|
||||||
|
|
13
nagios-nrpe/tasks/remount_usr_rw.yml
Normal file
13
nagios-nrpe/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