forked from evolix/ansible-roles
Jérémy Lecour
b9b0183ec5
It is arguable that this is a real change or not, but in practice we have playbooks that report changes only for this and it's very fun to scroll back each time to see if it's remount-usr or a "real" change.
18 lines
367 B
YAML
18 lines
367 B
YAML
---
|
|
- name: "check if /usr is a read-only partition"
|
|
command: 'grep -E " /usr.*ro" /proc/mounts'
|
|
args:
|
|
warn: no
|
|
changed_when: False
|
|
failed_when: False
|
|
check_mode: no
|
|
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
|
|
notify: remount usr
|