Remount /usr rw before writing on it

This commit is contained in:
Romain Dessort 2017-08-03 16:15:27 -04:00
parent b71db80afe
commit b8894cc509
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,15 @@
---
- 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")
args:
warn: no

View file

@ -25,6 +25,9 @@
# Warning: Need sudo!
become_user: "{{ evoadmin_username }}"
- include: remount_usr_rw.yml
when: evoadmin_scripts_dir | search ("/usr")
- name: "Create {{ evoadmin_scripts_dir }}"
file:
dest: "{{ evoadmin_scripts_dir }}"