ubuntu 14.04.3 LTS ansible version: 2.1.0, the sshport on remote server is 44022
Im using adhoc way to run synchronize module as a sudo user[nopasswd is not enabled] to synchronize local and remote directories (push)
Below is host file /etc/ansible/hosts
[webdb]
10.153.99.132
10.153.99.52
[webdb:vars]
ansible_ssh_user=ctuser
ansible_ssh_private_key_file=/root/.ssh/id_rsa
ansible_port=44022
Below are the command used:
ansible webdb -s -K -m synchronize -a "src=/tmp/muhan
dest=/store" -u ctuser
and (dest_port used)
ansible webdb -s -K -m synchronize -a "dest_port=44022
src=/tmp/muhan dest=/store" -u ctuser
Both commands outputs below error:-
10.153.99.52 | FAILED! => {
"changed": false,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /root/.ssh/id_rsa -S none -o StrictHostKeyChecking=no -o Port=44022' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"/tmp/muhan\" \"[email protected]:/store\"",
"failed": true,
"msg": "sudo: unable to resolve host c2.example.com\nsudo: no tty present and no askpass program specified\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.0]\n",
"rc": 12
}
10.153.99.132 | FAILED! => {
"changed": false,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /root/.ssh/id_rsa -S none -o StrictHostKeyChecking=no -o Port=44022' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"/tmp/muhan\" \"[email protected]:/store\"",
"failed": true,
"msg": "sudo: unable to resolve host c1.example.com\nsudo: no tty present and no askpass program specified\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.0]\n",
"rc": 12
}
-sand-Kare both deprecated. What do you get if you use-band--ask-become-pass? - MillerGeek