From 7880f7f2a75aac32aabeed9e3d26651ecab507bd Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 22 Oct 2017 23:31:46 +0000 Subject: [PATCH] keep property for filesystem to never format --- tasks/main.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 400454c..4adaf77 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -26,18 +26,20 @@ force: "{{ filesystems_state == 'formated' }}" with_items: "{{ filesystems }}" when: - item.device is defined and ( - filesystems_state == "mounted" or - filesystems_state == "formated" ) and - not item.fstype == "vfat" + - item.device is defined + - filesystems_state == "mounted" or + filesystems_state == "formated" + - not item.fstype == "vfat" + - not (item.keep is defined and item.keep) - name: format fat32 command: mkfs.fat -F32 {{ item.device }} with_items: "{{ filesystems }}" when: - item.device is defined and - filesystems_state == "formated" and - item.fstype == "vfat" + - item.device is defined + - filesystems_state == "formated" + - item.fstype == "vfat" + - not (item.keep is defined and item.keep) - name: mount filesystems mount: