ansible.posix
ansible.posix copied to clipboard
Use synchronize in AAP's job failed
SUMMARY
I have a job in AAP2.2. It is a ansible.posix.synchronize task. I have two issue.
- when I use password for accessing the remote server, it stuck in synchronize task like below, it seems waiting for input password.
-
when I use sshkey for accessing the remote server, it can run the synchronize task, but it failed with below messages
"msg": { "changed": false, "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/a root@
:/tmp/b", "failed": true, "msg": "Warning: Permanently added ' ,xx.xx.xx.xx' (ECDSA) to the list of known hosts.\r\nrsync: link_stat "/tmp/a" 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", <<<< no the source file /tmp/a(but actually exist in localhost)
My questions:
-
how to solve the case when I use password to access remote server?
-
Is the synchronize task supported in AAP's job? Note: I know in AAP's job, every playbook running in a container, then what the additional configure need in a AAP's template or other?
ISSUE TYPE
- Bug Report
COMPONENT NAME
ansible.posix.synchronize
ANSIBLE VERSION
ansible [core 2.13.8] provided by AAP 2.2
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
use below task in a AAP2.2 template and run.
- hosts: all
tasks:
- name: sync test
ansible.posix.synchronize:
src: /tmp/a
dest: /tmp/b
register: result
ignore_errors: yes
- name: debug result
debug:
msg: "{{ result }}"
EXPECTED RESULTS
execute successfully like ansible-playbook in commandline
when use commandline ansible-playbook
ok: [remoteserver] => {
"msg": {
"changed": true,
"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/a remoteserver:/tmp/b",
"failed": false,
"msg": "<f..t...... a\n",
"rc": 0,
"stdout_lines": [
"<f..t...... a"
]
}
}
ACTUAL RESULTS
-
stuck and hang in using password to access remote server.
-
failed with "rsync: link_stat "/tmp/a" 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"