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: tasks:
- name: remount filesystems - name: remount filesystems
command: command:
mount -oremount,{{ remount_state }} {{ item }} mount -oremount,{{ remount_state }} {{ item.mount }}
warn=false warn=false
with_items: >- with_items: >-
{{ {{
ansible_mounts ansible_mounts
| selectattr('mount', 'in', remount_fs) | selectattr('mount', 'in', remount_fs)
| map(attribute='mount')
| list | list
}} }}
when: not item.options.startswith(remount_state)