remount: Only remount if needed

Skip remounting filesystems that are already in the specified state.
ntfy
Dustin 2021-10-30 16:41:58 -05:00
parent 689d53abfd
commit 98401b3c1e
1 changed files with 2 additions and 2 deletions

View File

@ -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)