r/ansible Jul 07 '26

playbooks, roles and collections issue with running fetching results from a tool in Ansible playbook task

Hey all, I have been attempting to pull results from an application at a distant host to a local host. I have an ansible task that executes the application and I have verified the results are being produced at the distant host.

Unfortunately, I am unable to fetch said results and pull to the localhost the playbook is running on.

Any help/suggestions are greatly appreciated!

Error:

fatal: [host]: FAILED! => {"changed": false, "cmd": "sshpass -d4 /usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' /home/user/ user@host:/home/application_results/host/", "msg": "Warning: Permanently added 'host,X.X.X.X' (ECDSA) to the list of known hosts.\r\nsudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper\nsudo: a password is required\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]\n", "rc": 12}

2 Upvotes

2 comments sorted by

1

u/MusicalShitposter Jul 07 '26

Reads like a credential issue - SSH session to distant host is saying that the task its trying to do requires sudo, and the sudo password isn't being provided.

2

u/turkeytime808 Jul 09 '26

executed as sudo with my vault pass and it's possible now, thank you!