diff --git a/CHANGELOG.md b/CHANGELOG.md index a1170f72..07d255ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Changed * evolinux-base: many improvements for backup-server-state script +* remount-usr: use findmnt to find if usr is a readonly partition ### Fixed diff --git a/remount-usr/tasks/main.yml b/remount-usr/tasks/main.yml index 6cbcfa00..1bfedc64 100644 --- a/remount-usr/tasks/main.yml +++ b/remount-usr/tasks/main.yml @@ -1,10 +1,10 @@ --- +# 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: 'grep -E " /usr.*ro" /proc/mounts' - args: - warn: no + command: 'findmnt /usr --noheadings --options ro' changed_when: False - failed_when: False + failed_when: usr_partition.rc > 1 check_mode: no register: usr_partition