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
|
2023-12-08 10:11:45 +01:00
|
|
|
|
2017-11-15 12:21:30 +01:00
|
|
|
- name: "check if /usr is a read-only partition"
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: '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
|
2024-02-07 15:43:23 +01:00
|
|
|
register: usr_partition
|
2023-12-08 10:11:45 +01:00
|
|
|
check_mode: False
|
2017-11-07 12:18:02 +01:00
|
|
|
|
2017-11-15 12:21:30 +01:00
|
|
|
- name: "mount /usr in rw"
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.command:
|
2024-02-07 15:43:23 +01:00
|
|
|
cmd: 'mount --options remount,rw /usr'
|
|
|
|
when: usr_partition.rc == 0
|
2017-11-07 12:18:02 +01:00
|
|
|
notify: remount usr
|
2023-12-08 10:11:45 +01:00
|
|
|
changed_when: False
|