From e88f592c4d0bfb074bc92f73e96c39dbb4e71c4b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 17 Mar 2022 16:12:05 +0000 Subject: [PATCH] encrypt-file: roll back extended file stat Change I8e7bc38c68c224795630b90a1b989098a7661491 switched the "Validate input file" task to use a path stat, but when a list of files is passed into encrypt_file this fails because the list is treated as a string. Switch back to the more naive "is undefined" check until it can be properly redone with a loop or similar and appropriate tests added. Change-Id: I83e665bc890aec42462776e0079457bb4506552f --- roles/encrypt-file/tasks/main.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/roles/encrypt-file/tasks/main.yaml b/roles/encrypt-file/tasks/main.yaml index 30f6ce5c7..07b701cc3 100644 --- a/roles/encrypt-file/tasks/main.yaml +++ b/roles/encrypt-file/tasks/main.yaml @@ -1,12 +1,7 @@ -- name: Stat input file - stat: - path: '{{ encrypt_file }}' - register: _stat_result - - name: Validate input file fail: - msg: '{{ encrypt_file }} : file does not exist' - when: not _stat_result.stat.exists + msg: 'Must define "encrypt_file"' + when: encrypt_file is undefined - name: Ensure gpg2 installed package: