evocheck: remount /usr if needed

This commit is contained in:
Jérémy Lecour 2017-05-23 15:10:58 +02:00 committed by Jérémy Lecour
parent 5e6facd0ca
commit da3cafca48
2 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,8 @@
---
- include: remount_usr_rw.yml
when: evocheck_bin_dir | search ("/usr")
- name: Scripts dir is present
file:
path: "{{ evocheck_bin_dir }}"

View 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")