Hi,
We were recently upgraded to Ansible 2.1.0, from 1.9.4 (I think). Now have an issue with any playbooks that make use of the synchronize module. I have a a test playbook that simply copies a text file from Host A to Host B and the job is delegated to Host C.
cat test_connectivity.yml
- name: Copy the text file from /home/triarch/ansible_test.txt to target host to check ansible connectivity
hosts: ‘{{ target }}’
remote_user: triarch
gather_facts: no
tasks:
- name: copy over the test text file to /home/triarch
synchronize: mode=push src=/tmp/ansible_test.txt dest=/home/triarch
delegate_to: HostC
Output from running the playbook is;
[root@HostB]# ansible-playbook test_connectivity.yml --extra-vars “target=HostB” -vvv
Using /etc/ansible/ansible.cfg as config file
1 plays in test_connectivity.yml
PLAY [Copy the text file from /home/triarch/ansible_test.txt to target host to check ansible connectivity] ***
TASK [copy over the test text file to /hostname/triarch] ***********************
task path: /mnt/ansible/playbooks/mdi/test/test_connectivity.yml:7
ESTABLISH SSH CONNECTION FOR USER: triarch
SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt HostC’/bin/sh -c ‘"’“‘( umask 22 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865
” && echo “echo $HOME/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865
” )’”‘"’’
PUT /tmp/tmpL7jmA3 TO /home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/synchronize
SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r ‘[HostC]’
ESTABLISH SSH CONNECTION FOR USER: triarch
SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=triarch -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt HostC’/bin/sh -c ‘"’“‘LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/synchronize; rm -rf “/home/triarch/.ansible/tmp/ansible-tmp-1467723381.55-23670874385865/” > /dev/null 2>&1’”‘"’’
fatal: [HostB-> HostC]: FAILED! => {“changed”: false, “cmd”: “/usr/bin/rsync --delay-updates -F --compress --archive --rsh ‘/etc/ssh -S none -o StrictHostKeyChecking=no -o Port=22’ --out-format=‘<>%i %n%L’ "/tmp/ansible_test.txt" "HostB:/home/triarch"”, “failed”: true, “invocation”: {“module_args”: {“_local_rsync_path”: “rsync”, “_substitute_controller”: false, “archive”: true, “checksum”: false, “compress”: true, “copy_links”: null, “delete”: false, “dest”: “HostB:/home/triarch”, “dest_port”: “22”, “dirs”: false, “existing_only”: false, “group”: null, “links”: null, “mode”: “push”, “owner”: null, “partial”: false, “perms”: null, “private_key”: null, “recursive”: null, “rsync_opts”: null, “rsync_path”: null, “rsync_timeout”: 0, “set_remote_user”: true, “src”: “/tmp/ansible_test.txt”, “ssh_args”: null, “times”: null, “verify_host”: false}}, “msg”: “rsync: Failed to exec /etc/ssh: Permission denied (13)\nrsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.4]\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in IPC code (code 14) at io.c(632) [sender=3.0.4]\n”, “rc”: 14}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @test_connectivity.retry
PLAY RECAP *********************************************************************
HostB : ok=0 changed=0 unreachable=0 failed=1
Any ideas?
Thanks,
Mick