From 0cce86cac9010fbaa5190c28e4ff7bf7248f4935 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 25 Aug 2016 21:45:38 -0700 Subject: [PATCH] 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. --- lib/ansible/plugins/action/fetch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/fetch.py b/lib/ansible/plugins/action/fetch.py index 7b04b526906..693c8ddc8d1 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