configpolicy/remount.yml

21 lines
414 B
YAML

- hosts: all
gather_facts: true
vars:
remount_state: ro
remount_fs:
- /
- /usr
- /opt
tasks:
- name: remount filesystems
command:
mount -oremount,{{ remount_state }} {{ item.mount }}
warn=false
with_items: >-
{{
ansible_mounts
| selectattr('mount', 'in', remount_fs)
| list
}}
when: not item.options.startswith(remount_state)