summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2016-08-25 21:45:38 -0700
committerGitHub <noreply@github.com>2016-08-25 21:45:38 -0700
commitf57f33a8e73d1ac10b3eb6b4333e635c1608bc27 (patch)
treea496910cc672daf18cf6d0e60534a205c0ef469f
parentfb9b98a5435cc3506e2dfaf75c1d8998582f99df (diff)
downloadansible-f57f33a8e73d1ac10b3eb6b4333e635c1608bc27.tar.gz
Fix fetch idempotence (#17255)
Fetch always follows symlinks when downloading so it needs to always follow symlinks when getting the checksum of the file as well.
-rw-r--r--lib/ansible/plugins/action/fetch.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/plugins/action/fetch.py b/lib/ansible/plugins/action/fetch.py
index 7b04b52690..693c8ddc8d 100644
--- a/lib/ansible/plugins/action/fetch.py
+++ b/lib/ansible/plugins/action/fetch.py
@@ -64,7 +64,8 @@ class ActionModule(ActionBase):
remote_checksum = None
if not self._play_context.become:
# calculate checksum for the remote file, don't bother if using become as slurp will be used
- remote_checksum = self._remote_checksum(source, all_vars=task_vars)
+ # Force remote_checksum to follow symlinks because fetch always follows symlinks
+ remote_checksum = self._remote_checksum(source, all_vars=task_vars, follow=True)
# use slurp if permissions are lacking or privilege escalation is needed
remote_data = None