I need to set the contents of a dest folder to be the same as my src folder. So I am using the synchronize module:
- name: files for /lib/user/ based on the Runtime version
synchronize:
src: "/data/managedFiles/lib/{{ runtime.version }}/user/"
dest: "{{ mule_directory }}{{ mule_runtime_name }}/lib/user/"
delete: yes
register: result
But this sets "changed" to 'true' in result, even when there was no change. I need this to be only set to 'true' if there was a something changed because the next task tests for this state.
If I repeat the same synchronize task right after this one it doesn't set 'changed' to 'true'. But that one always doesn't get set to 'true'.
Subsequent runs of the play with no change to the src ("/data/managedFiles/lib/{{ runtime.version }}/user/") always set result with 'changed'.