Cygwin breaking ansible

57 views
Skip to first unread message

lpesc...@google.com

unread,
Jan 30, 2018, 4:59:24 PM1/30/18
to Ansible Project
Hi folks, I have a WEIRD problem. 
After running cygwin ssh-host-config on my PC, which starts sshd and rsync services, suddenly I can no longer run ansible. 
I get this error:

root@Raspi_Ctrl:/ansible/playbook/nuc# ansible -i /ansible/hosts nuc -m win_ping

 [WARNING]: FATAL ERROR DURING FILE TRANSFER: Traceback (most recent call last):   File

"/usr/local/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py", line 276, in _winrm_exec

self._winrm_send_input(self.protocol, self.shell_id, command_id, data, eof=is_last)   File

"/usr/local/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py", line 256, in _winrm_send_input

protocol.send_message(xmltodict.unparse(rq))   File "/usr/local/lib/python2.7/dist-

packages/winrm/protocol.py", line 207, in send_message     return self.transport.send_message(message)   File

"/usr/local/lib/python2.7/dist-packages/winrm/transport.py", line 202, in send_message     raise

WinRMTransportError('http', error_message) WinRMTransportError: (u'http', u'Bad HTTP response returned from

server. Code 500')


100.126.255.201 | FAILED! => {

    "msg": "winrm send_input failed"

}

root@Raspi_Ctrl:/ansible/playbook/nuc# ansible -i /ansible/hosts nuc -m win_ping

100.126.255.201 | UNREACHABLE! => {

    "changed": false, 

    "msg": "basic: HTTPSConnectionPool(host='100.126.255.201', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x749335b0>, 'Connection to 100.126.255.201 timed out. (connect timeout=30)'))", 

    "unreachable": true

}




When I run system restore to before this ssd-host-config, I can reach it again. 

rsync uses port 873, sshd uses 22, and I believe ansible uses 5986 so there should be no conflict. 


Has anyone else had this issue?


By the way, this is the script that does the config. I do have this set to become: so i dont think it's a privelege thing.


#!/bin/bash


#::Configure sshd service

if ! ssh-host-config --yes --pwd "foo"; then

    echo "ERROR: Failed to configure sshd"

    exit 1

fi

#echo db_home: /cygdrive/c/home/YRunner > C:\cygwin\etc\nsswitch.conf || exit /b 1


if ! net start sshd; then

    echo "ERROR: Failed to start sshd service."

exit 1

fi


#configure the rsyncd service

cat <<EOF > /etc/rsyncd.conf

use chroot = yes


[yrunner_rsyncer]

#path = /cygdrive/c/home/YRunner

comment = YRunner Rsyncer

auth users = YRunner

secrets file = /etc/rsyncd.secrets

write only = false

read only = false

list = true

strict modes = false

hosts allow = *

EOF



/usr/bin/cygrunsrv.exe --install "rsyncd" --path /usr/bin/rsync --args "--daemon --no-detach" -f "Rsync daemon service"

if [[ "$?" -ne 0 ]]; then

    echo "ERROR: Failed to install rsyncd service"

    exit 1

fi


net start rsyncd

lpesc...@google.com

unread,
Feb 1, 2018, 1:31:19 PM2/1/18
to Ansible Project
Bumping-Anyone at all know why?

lpesc...@google.com

unread,
Feb 9, 2018, 5:38:57 PM2/9/18
to Ansible Project
Bump, again.


On Tuesday, January 30, 2018 at 1:59:24 PM UTC-8, lpesc...@google.com wrote:

J Hawkesworth

unread,
Feb 12, 2018, 4:43:43 AM2/12/18
to Ansible Project
My guess would be that whatever you are doing with cygwin it is somehow upsetting the network stack.

If it fixes itself after a period of time then maybe just stick in a big pause, then do a wait_for_connection to make sure you can still connect and then proceed with the rest of your playbook?

hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages