diff --git a/lib/ansible/utils/vault.py b/lib/ansible/utils/vault.py index 00f314af56..b25f19c155 100644 --- a/lib/ansible/utils/vault.py +++ b/lib/ansible/utils/vault.py @@ -51,7 +51,11 @@ def is_encrypted(filename): # read first line of the file with open(filename) as f: - head = f.next() + try: + head = f.next() + except StopIteration: + # empty file, so not encrypted + return False if head.startswith(HEADER): return True