Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

synchronize module

ANSIBLE VERSION

ansible 2.0.1.0
config file = /Users/duff/camp-ansible/ansible.local.cfg
configured module search path = Default w/o overrides

CONFIGURATION

Ansible config

timeout = 30
ssh_args = -F config_ssh_local -o ControlMaster=auto -o ControlPersist=30m
pipelining = True
[accelerate]
accelerate_port = 5099
accelerate_timeout = 30
accelerate_connect_timeout = 5.0
accelerate_daemon_timeout = 30

ssh config : i use a specific deploy account different to the connect user:

Host BASTION
User myuser
ForwardAgent yes
ProxyCommand none
BatchMode yes
GSSAPIAuthentication no

Host *
User myuser
GSSAPIAuthentication no
ProxyCommand ssh -F config_ssh_local -W %h:%p BASTION

OS / ENVIRONMENT

Running from Mac OSX Yosemith.

Target host is on ubuntu 14.04 TLS

SUMMARY

synchronized from tow remote host no more works on 2.0.1

STEPS TO REPRODUCE

ansible-playbook -b --become-user=deployUser --ask-become-pass playbooks/test_sync.yml

- name: "POC Rsync"
hosts: hostA
tasks:
- name: "rsync from hostB to hostA"
synchronize: src=/etc/resolv.conf dest=/tmp/resolv.conf set_remote_user=no
delegate_to: hostB

EXPECTED RESULTS

file rsync from hostB on /etc/resolv.conf to hostA on /tmp/resolv.conf

it's works with 1.9.4

PLAY [POC Rsync] **************************************************************

GATHERING FACTS ***************************************************************
<hostA> ESTABLISH CONNECTION FOR USER: myuser
<hostA> REMOTE_MODULE setup
<hostA> EXEC ssh -C -vvv -F config_ssh_axa -o ControlMaster=auto -o ControlPersist=30m -o ControlPath="/Users/myuser/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 hostA /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=keyfgwrkratqtowjerpwxbwputeuhjrh] password: " -u deployUser /bin/sh -c '"'"'echo BECOME-SUCCESS-keyfgwrkratqtowjerpwxbwputeuhjrh; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'"'"''
ok: [hostA]

TASK: [rsync depuis hostB vers hostA] ************************************
<hostB> ESTABLISH CONNECTION FOR USER: myuser
<hostB> EXEC ssh -C -vvv -F config_ssh_axa -o ControlMaster=auto -o ControlPersist=30m -o ControlPath="/Users/myuser/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 hostB /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=ipbqeyvlxtmgmkdlwqcloznrfpuuwkgp] password: " -u deployUser /bin/sh -c '"'"'echo BECOME-SUCCESS-ipbqeyvlxtmgmkdlwqcloznrfpuuwkgp; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'"'"''
ok: [hostA -> hostB] => {"changed": false, "cmd": "rsync --delay-updates -F --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no' --out-format='<<CHANGED>>%i %n%L' \"/etc/resolv.conf\" \"hostA:/tmp/resolv.conf\"", "msg": "", "rc": 0, "stdout_lines": []}

ACTUAL RESULTS

$ ./ansible-playbook_wrapper playbooks/test_sync.yml -vvvv
Using /Users/duff/camp-ansible/ansible.local.cfg as config file
SUDO password:
Loaded callback default of type stdout, v2.0
1 plays in playbooks/test_sync.yml

PLAY [POC Rsync] ***************************************************************

TASK [setup] *******************************************************************
<hostA> ESTABLISH SSH CONNECTION FOR USER: None
<hostA> SSH: EXEC ssh -C -vvv -F config_ssh_local -o ControlMaster=auto -o ControlPersist=30m -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/Users/duff/.ansible/cp/ansible-ssh-%h-%p-%r hostA '/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible, key=ffvxikzutrqlropmbltuprkzjlyhtlev] password: " -u deployUser /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ffvxikzutrqlropmbltuprkzjlyhtlev; /bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 /usr/bin/python'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''
ok: [hostA]

TASK [rsync from hostB to hostA] **************************************
task path: /Users/duff/dev/sources/axa/camp-ansible/playbooks/test_sync.yml:10
<hostB> ESTABLISH SSH CONNECTION FOR USER: None
<hostB> SSH: EXEC ssh -C -vvv -F config_ssh_axa -o ControlMaster=auto -o ControlPersist=30m -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/Users/duff/.ansible/cp/ansible-ssh-%h-%p-%r hostB '/bin/sh -c '"'"'LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 /usr/bin/python'"'"''
fatal: [hostA -> hostB]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh '/usr/bin/ssh -S none -o StrictHostKeyChecking=no' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"/etc/resolv.conf\" \"hostA:/tmp/resolv.conf\"", "failed": true, "invocation": {"module_args": {"_local_rsync_path": "rsync", "_substitute_controller": false, "archive": true, "checksum": false, "compress": true, "copy_links": null, "delete": false, "dest": "hostA:/tmp/resolv.conf", "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": "\"sudo rsync\"", "rsync_timeout": 0, "set_remote_user": false, "src": "/etc/resolv.conf", "ssh_args": null, "times": null, "verify_host": false}}, "msg": "sudo: 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}

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

ios_facts

ansible_connection

ANSIBLE VERSION

ansible 2.4.0 (junos-tests-fix-port 8228b11b55) last updated 2017/08/01 08:35:32 (GMT -400)
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/Users/dnewswan/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /Users/dnewswan/code/ansible/lib/ansible
executable location = /Users/dnewswan/code/ansible/bin/ansible
python version = 2.7.13 (default, Apr 4 2017, 08:47:57) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)]

CONFIGURATION

OS / ENVIRONMENT

SUMMARY

ios_facts throws an unable to connect to socket error. Inspecting the logs from ansible-connection reveals a stack trace with a error: [Errno 9] Bad file descriptor and a NoneType error in the network_cli connection plugin.

STEPS TO REPRODUCE

run tests with ANSIBLE_LOG_PATH=./log ansible-playbook -i inventory.network -vvvv -k -u cisco ios.yaml -e limit_to=ios_facts

open up the log file to find the ansible-connection stack trace.

This issue does not appear to affect the other iosxr modules, and running the tests multiple times demonstrates that it is probably not a flake either.

EXPECTED RESULTS

Test should pass.

ACTUAL RESULTS

2017-08-01 10:18:29,151 p=61276 u=dnewswan | TASK [ios_facts : test getting all facts] ************************************************************************************************************************************************************************************************************************************
2017-08-01 10:18:29,151 p=61276 u=dnewswan | task path: /Users/dnewswan/code/ansible/test/integration/targets/ios_facts/tests/cli/all_facts.yaml:5
2017-08-01 10:18:30,394 p=61350 u=dnewswan | re-using existing socket for cisco@ios01:22
2017-08-01 10:18:30,394 p=61046 u=dnewswan | incoming request accepted on persistent socket
2017-08-01 10:18:30,394 p=61046 u=dnewswan | socket operation is CONTEXT
2017-08-01 10:18:30,395 p=61046 u=dnewswan | updating play_context for connection
2017-08-01 10:18:30,473 p=61046 u=dnewswan | socket operation completed with rc 0
2017-08-01 10:18:30,474 p=61046 u=dnewswan | socket operation is RUN
2017-08-01 10:18:30,474 p=61046 u=dnewswan | socket operation completed with rc 0
2017-08-01 10:18:32,285 p=61356 u=dnewswan | re-using existing socket for cisco@ios01:22
2017-08-01 10:18:32,286 p=61046 u=dnewswan | incoming request accepted on persistent socket
2017-08-01 10:18:32,286 p=61046 u=dnewswan | socket operation is CONTEXT
2017-08-01 10:18:32,286 p=61046 u=dnewswan | updating play_context for connection
2017-08-01 10:18:32,286 p=61046 u=dnewswan | socket operation completed with rc 0
2017-08-01 10:18:32,287 p=61046 u=dnewswan | socket operation is EXEC
2017-08-01 10:18:32,287 p=61046 u=dnewswan | socket operation completed with rc 0
2017-08-01 10:18:32,937 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/basic.py
2017-08-01 10:18:32,938 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/six/__init__.py
2017-08-01 10:18:32,939 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/ios.py
2017-08-01 10:18:33,040 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/_text.py
2017-08-01 10:18:33,041 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/parsing/convert_bool.py
2017-08-01 10:18:33,041 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/parsing/__init__.py
2017-08-01 10:18:33,041 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/pycompat24.py
2017-08-01 10:18:33,124 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/connection.py
2017-08-01 10:18:33,125 p=61276 u=dnewswan | Using module_utils file /Users/dnewswan/code/ansible/lib/ansible/module_utils/network_common.py
2017-08-01 10:18:33,140 p=61276 u=dnewswan | Using module file /Users/dnewswan/code/ansible/lib/ansible/modules/network/ios/ios_facts.py
2017-08-01 10:18:33,886 p=61046 u=dnewswan | incoming request accepted on persistent socket
2017-08-01 10:18:33,886 p=61046 u=dnewswan | socket operation is EXEC
2017-08-01 10:18:43,887 p=61046 u=dnewswan | commnad timeout triggered, timeout value is 10 secs
2017-08-01 10:18:43,888 p=61046 u=dnewswan | shutdown persistent connection requested
2017-08-01 10:18:43,888 p=61046 u=dnewswan | closing local listener
2017-08-01 10:18:43,888 p=61046 u=dnewswan | closing the connection
2017-08-01 10:18:43,888 p=61046 u=dnewswan | closing ssh connection to device
2017-08-01 10:18:43,889 p=61046 u=dnewswan | firing event: on_close_shell()
2017-08-01 10:18:43,889 paramiko.transport [chan 0] EOF sent (0)
2017-08-01 10:18:43,889 p=61046 u=dnewswan | cli session is now closed
2017-08-01 10:18:43,978 paramiko.transport EOF in transport thread
2017-08-01 10:18:44,006 p=61046 u=dnewswan | ssh connection has been closed successfully
2017-08-01 10:18:44,007 p=61046 u=dnewswan | removing the local control socket
2017-08-01 10:18:44,010 p=61046 u=dnewswan | shutdown complete
2017-08-01 10:18:44,011 p=61046 u=dnewswan | Traceback (most recent call last):
File "/Users/dnewswan/code/ansible/lib/ansible/plugins/connection/network_cli.py", line 174, in send
return self.receive(command, prompts, answer)
File "/Users/dnewswan/code/ansible/lib/ansible/plugins/connection/network_cli.py", line 151, in receive
data = self._shell.recv(256)
AttributeError: 'NoneType' object has no attribute 'recv'

2017-08-01 10:18:44,011 p=61046 u=dnewswan | socket operation completed with rc 1
2017-08-01 10:18:44,012 p=61046 u=dnewswan | Traceback (most recent call last):
File "/Users/dnewswan/code/ansible/bin/ansible-connection", line 132, in run
(s, addr) = self.socket.accept()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 206, in accept
sock, addr = self._sock.accept()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 174, in _dummy
raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor

2017-08-01 10:18:44,012 p=61046 u=dnewswan | shutdown persistent connection requested
2017-08-01 10:18:44,012 p=61046 u=dnewswan | persistent connection is not active
2017-08-01 10:18:44,013 p=61046 u=dnewswan | shutdown local socket, connection was active for 0:00:58.412986 secs
2017-08-01 10:18:44,162 p=61276 u=dnewswan | The full traceback is:
File "/var/folders/ql/d9_087wj4cd10grvwzxmk4hc0000gn/T/ansible_sOJXfs/ansible_modlib.zip/ansible/module_utils/connection.py", line 67, in exec_command
sf.connect(module._socket_path)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)

2017-08-01 10:18:44,163 p=61276 u=dnewswan | fatal: [ios01]: FAILED! => {
"changed": false,
"err": "[Errno 2] No such file or directory",
"failed": true,
"invocation": {
"module_args": {
"auth_pass": null,
"authorize": null,
"gather_subset": [
"all"
],
"host": null,
"password": null,
"port": null,
"provider": null,
"ssh_keyfile": null,
"timeout": null,
"username": null
}
},
"msg": "unable to connect to socket"
}