ansible-roles/remount-usr/tasks/main.yml

19 lines
508 B
YAML
Raw Permalink Normal View History

---
# 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"
ansible.builtin.command:
cmd: 'findmnt /usr --noheadings --options ro'
changed_when: False
failed_when: usr_partition.rc > 1
register: usr_partition
check_mode: False
2017-11-15 12:21:30 +01:00
- name: "mount /usr in rw"
ansible.builtin.command:
cmd: 'mount --options remount,rw /usr'
when: usr_partition.rc == 0
notify: remount usr
changed_when: False