From f8bf2ba1bd7cc8f522e5190486edd25c2fb334e7 Mon Sep 17 00:00:00 2001 From: Pablo Figue Date: Wed, 13 Aug 2014 14:58:17 +0200 Subject: [PATCH] Encrypt the vault file after editing only if the contents changed --- lib/ansible/parsing/vault/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/parsing/vault/__init__.py b/lib/ansible/parsing/vault/__init__.py index 2aab6fdfe4..f3cee27ea4 100644 --- a/lib/ansible/parsing/vault/__init__.py +++ b/lib/ansible/parsing/vault/__init__.py @@ -227,6 +227,10 @@ class VaultEditor(object): call(self._editor_shell_command(tmp_path)) tmpdata = self.read_data(tmp_path) + # Do nothing if the content has not changed + if existing_data == tmpdata: + return + # create new vault this_vault = VaultLib(self.password) if cipher: