Recently we switched to Ansible automation platform 2.3. My execution environment is ee-supported-rhel8 which contains the Ansible.posix.synchronize module.
When I execute a synchronize module it is failing with:
"src: /tmp/memo.txt no such file".
It was running in Tower 1.2 without any issue.
- Name: Install rsync on the Target
package:
name: rsync
state: present
- Name: Synchronize file from local to remote
synchronize:
src: /tmp/memo.txt
dest: /temp/test
Error
"cmd":
"/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --out-format='<<CHANGED>>%i %n%L' /tmp/memo.txt root@xyz1234:/tmp/test"
,
"msg": "Warning: Permanently added 'xyz1234,148.168.65.73' (ECDSA) to the list of known hosts.
\r\nWARNING!\n This system,…
For additional information consult your local business's employee
privacy notice or contact your local Privacy Officer. \nrsync:
link_stat "/tmp/memo.txt" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous
errors) (code 23) at main.c(1189) [sender=3.1.3]\n",
I kept the source file in both control node and execution node it is still failing.
I also kept the source in a separate remote server. That is also failing. It is throwing error both source and target cannot be in remote.
Please suggest.
Best Answer
The error says:
Short answer: The file /tmp/memo.txt is missing on the controller.
Details: The first example shows how to use the module
For example, the below play
synchronizes the file /tmp/memo.txt on the controller to the file /tmp/test on the remote host test_01. Given the file on the controller
make sure the file is synchronized to the remote host
The error can be reproduced by removing the file /tmp/memo.txt from the controller: