diff --git a/remount.yml b/remount.yml new file mode 100644 index 0000000..74d3539 --- /dev/null +++ b/remount.yml @@ -0,0 +1,20 @@ +- hosts: all + gather_facts: true + vars: + remount_state: ro + remount_fs: + - / + - /usr + - /opt + tasks: + - name: remount filesystems + command: + mount -oremount,{{ remount_state }} {{ item }} + warn=false + with_items: >- + {{ + ansible_mounts + | selectattr('mount', 'in', remount_fs) + | map(attribute='mount') + | list + }}