From 98401b3c1ecf2957349e6f470bd7b51fe3f87261 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 30 Oct 2021 16:41:58 -0500 Subject: [PATCH] remount: Only remount if needed Skip remounting filesystems that are already in the specified state. --- remount.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remount.yml b/remount.yml index 74d3539..deeb4a9 100644 --- a/remount.yml +++ b/remount.yml @@ -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)