forked from evolix/ansible-roles
Remount /usr only if it is a dedicated partition
This commit is contained in:
parent
095693582a
commit
5a7a561cca
|
@ -5,10 +5,20 @@
|
|||
path: /usr/local/lib/nagios/plugins/
|
||||
register: nagios_plugins_dir
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr warn=no
|
||||
- name: Check if /usr is a partition
|
||||
shell: "mount | grep 'on /usr type'"
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: nagios_plugins_dir.stat.exists
|
||||
failed_when: False
|
||||
register: usr_partition
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0 and nagios_plugins_dir.stat.exists
|
||||
|
||||
# https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3367&cf_id=30
|
||||
- name: Install Nagios plugin
|
||||
|
|
|
@ -39,9 +39,20 @@
|
|||
state: latest
|
||||
default_release: "{{ evoacme_certbot_release }}"
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr warn=no
|
||||
- name: Check if /usr is a partition
|
||||
shell: "mount | grep 'on /usr type'"
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: usr_partition
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0
|
||||
|
||||
- name: Remove certbot symlink for apt install
|
||||
file:
|
||||
|
|
|
@ -30,12 +30,27 @@
|
|||
when: filebeat_logstash_plugin and logstash_plugin.stat.exists
|
||||
|
||||
- block:
|
||||
- name: /usr is mounted as "rw"
|
||||
command: mount -oremount,rw /usr
|
||||
- name: Check if /usr is a partition
|
||||
shell: "mount | grep 'on /usr type'"
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: usr_partition
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0
|
||||
|
||||
- name: Logstash plugin is installed
|
||||
command: /usr/share/logstash/bin/logstash-plugin install logstash-input-beats
|
||||
|
||||
- name: /usr is remounted
|
||||
command: mount -oremount /usr
|
||||
when: filebeat_logstash_plugin and logstash_plugin.stat.exists and not logstash_plugin_installed | success
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0 and filebeat_logstash_plugin and logstash_plugin.stat.exists and not logstash_plugin_installed | success
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
---
|
||||
- include: packages.yml
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr warn=no
|
||||
- name: Check if /usr is a partition
|
||||
shell: "mount | grep 'on /usr type'"
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: usr_partition
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0
|
||||
|
||||
- include: munin.yml
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
---
|
||||
- name: Intall monitorings plugins
|
||||
- name: Intall monitorings plugins
|
||||
apt:
|
||||
name: monitoring-plugins
|
||||
state: present
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr warn=no
|
||||
- name: Check if /usr is a partition
|
||||
shell: "mount | grep 'on /usr type'"
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: usr_partition
|
||||
|
||||
- name: Mount /usr in rw
|
||||
command: mount -o remount,rw /usr
|
||||
args:
|
||||
warn: no
|
||||
changed_when: False
|
||||
when: usr_partition.rc == 0
|
||||
|
||||
- name: Create Nagios plugins dir
|
||||
file:
|
||||
|
|
Loading…
Reference in a new issue