ansible-roles/remount-usr/tasks/main.yml
Jérémy Lecour 2849039fad
Some checks reported errors
continuous-integration/drone/push Build was killed
remount-usr: use findmnt to find if usr is a readonly partition
2022-01-27 11:21:19 +01:00

18 lines
468 B
YAML

---
# findmnt returns 0 on hit, 1 on miss
# If the return code is higher than 1, it's a blocking failure
- name: "check if /usr is a read-only partition"
command: 'findmnt /usr --noheadings --options ro'
changed_when: False
failed_when: usr_partition.rc > 1
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