--- /dev/null
+---
+# The SATA controllers on the boards that are running the armhf
+# nodes are somewhat flaky, and the root filesystem often ends
+# up readonly due to errors. When the FS goes read-only, jobs
+# will fail so the easiest action is to have the node reboot.
+common_node_rootfs_readonly_reboot: true
--- /dev/null
+#!/usr/bin/bash
+
+IFS=',' read -r -a OPTIONS < <(findmnt --json / | jq -r '.[][0]["options"]')
+RO=
+for OPTION in "${OPTIONS[@]}" ; do
+ if [[ "${OPTION}" == "ro" ]] ; then
+ RO=0
+ break
+ fi
+done
+
+if [[ "${RO}" == "0" ]] ; then
+ echo "'/' is mounted read-only, rebooting"
+ shutdown -r "+1"
+fi
- include: setup-Suse.yml
when: ansible_os_family == 'Suse'
+
+- when: common_node_rootfs_readonly_reboot|default(false)
+ block:
+ - name: Install readonly reboot script
+ ansible.builtin.copy:
+ dest: '/usr/sbin/readonly_root_reboot.sh'
+ src: 'readonly_root_reboot.sh'
+ owner: 'root'
+ group: 'root'
+ mode: '0750'
+ - name: Add cronjob
+ ansible.builtin.cron:
+ name: 'readonly_root_reboot'
+ job: '/usr/sbin/readonly_root_reboot.sh'
+ cron_file: 'readonly_root_reboot'
+ minute: '*/10'
+ user: 'root'