From c66438a2a36d314e423281b05eec5a967aa32924 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 23 May 2017 14:55:31 +0200 Subject: [PATCH] evolinux-base: remount /usr when needed --- evolinux-base/tasks/remount_usr_rw.yml | 13 +++++++++++++ evolinux-base/tasks/system.yml | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 evolinux-base/tasks/remount_usr_rw.yml diff --git a/evolinux-base/tasks/remount_usr_rw.yml b/evolinux-base/tasks/remount_usr_rw.yml new file mode 100644 index 00000000..a62d86d6 --- /dev/null +++ b/evolinux-base/tasks/remount_usr_rw.yml @@ -0,0 +1,13 @@ +--- +- name: Get mount options for partitions + shell: "mount | grep 'on /usr type'" + args: + warn: no + register: mount + changed_when: False + failed_when: False + when: not ansible_check_mode + +- name: Remount /usr if it is a partition and it is not mounted in rw + command: "mount -o remount,rw /usr" + when: mount.rc == 0 and not mount.stdout_lines.0 | search("rw") diff --git a/evolinux-base/tasks/system.yml b/evolinux-base/tasks/system.yml index 0e80ad85..732f52db 100644 --- a/evolinux-base/tasks/system.yml +++ b/evolinux-base/tasks/system.yml @@ -41,6 +41,8 @@ # TODO : find a way to force the console-data configuration # non-interactively (like tzdata ↑) +- include: remount_usr_rw.yml + - name: Setting vim as default editor alternatives: name: editor