Thank you Jordan. I did not know you could set ansible_remote_tmp at the
task level. I will try that. As a work around before I saw your answer, I
just build a filter to return the md5 as follows:
- name: Calculate md5sum from local file
set_fact: qcow_md5sum="{{
ansible_remote_tmp is a shell option so it isn't affected by delegate_to as
you have seen it will use what was set before. To get around this you can
set ansible_remote_tmp on the task itself to a temp dir that exists on the
local host like so;
- name: Calculate md5sum from local file
stat: