remount: Only remount if needed
Skip remounting filesystems that are already in the specified state.ntfy
parent
689d53abfd
commit
98401b3c1e
|
@ -9,12 +9,12 @@
|
|||
tasks:
|
||||
- name: remount filesystems
|
||||
command:
|
||||
mount -oremount,{{ remount_state }} {{ item }}
|
||||
mount -oremount,{{ remount_state }} {{ item.mount }}
|
||||
warn=false
|
||||
with_items: >-
|
||||
{{
|
||||
ansible_mounts
|
||||
| selectattr('mount', 'in', remount_fs)
|
||||
| map(attribute='mount')
|
||||
| list
|
||||
}}
|
||||
when: not item.options.startswith(remount_state)
|
||||
|
|
Loading…
Reference in New Issue