2017-11-07 12:18:02 +01:00
|
|
|
---
|
2022-01-27 11:21:19 +01:00
|
|
|
# findmnt returns 0 on hit, 1 on miss
|
|
|
|
# If the return code is higher than 1, it's a blocking failure
|
2017-11-15 12:21:30 +01:00
|
|
|
- name: "check if /usr is a read-only partition"
|
2022-01-27 11:21:19 +01:00
|
|
|
command: 'findmnt /usr --noheadings --options ro'
|
2017-11-07 12:18:02 +01:00
|
|
|
changed_when: False
|
2022-01-27 11:21:19 +01:00
|
|
|
failed_when: usr_partition.rc > 1
|
2017-11-07 12:18:02 +01:00
|
|
|
check_mode: no
|
|
|
|
register: usr_partition
|
|
|
|
|
2017-11-15 12:21:30 +01:00
|
|
|
- name: "mount /usr in rw"
|
|
|
|
command: 'mount -o remount,rw /usr'
|
2017-11-07 12:18:02 +01:00
|
|
|
args:
|
|
|
|
warn: no
|
2018-08-06 15:01:52 +02:00
|
|
|
changed_when: False
|
2017-11-07 12:18:02 +01:00
|
|
|
when: usr_partition.rc == 0
|
|
|
|
notify: remount usr
|