ansible ping failure to windows host

46 views
Skip to first unread message

Yehuda Pinhas

unread,
Feb 20, 2020, 7:41:05 AM2/20/20
to Ansible Project
Hi guys!

I have issues with ansible ping (python module validation) with Windows Server 2019 host.


This is the result:
[ansible@Netauto-Dev new_branch]$ ansible dhcp-test -m ping -vvvv

2020-02-20 14:37:56,686 p=ansible u=123991 | ansible 2.9.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/etc/ansible/my_modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  7 201900:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
2020-02-20 14:37:56,686 p=ansible u=123991 | Using /etc/ansible/ansible.cfg as config file
2020-02-20 14:37:56,687 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,697 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/POC_ENV.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,697 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/POC_ENV.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,702 p=ansible u=123991 | Parsed /etc/ansible/inventory/POC_ENV.yml inventory source with yaml plugin
2020-02-20 14:37:56,703 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,703 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/SNIF_AGGREGATOR.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,703 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/SNIF_AGGREGATOR.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,708 p=ansible u=123991 | Parsed /etc/ansible/inventory/SNIF_AGGREGATOR.yml inventory source with yaml plugin
2020-02-20 14:37:56,708 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,708 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/avaya.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,709 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/avaya.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,710 p=ansible u=123991 | Skipping empty key (hosts) in group (AVAYA)
2020-02-20 14:37:56,711 p=ansible u=123991 | Parsed /etc/ansible/inventory/avaya.yml inventory source with yaml plugin
2020-02-20 14:37:56,711 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,711 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/branch_switch.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,711 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/branch_switch.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,868 p=ansible u=123991 | Parsed /etc/ansible/inventory/branch_switch.yml inventory source with yaml plugin
2020-02-20 14:37:56,868 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,869 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/nexus.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,869 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/nexus.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,876 p=ansible u=123991 | Parsed /etc/ansible/inventory/nexus.yml inventory source with yaml plugin
2020-02-20 14:37:56,876 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,876 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_IPVPN_20M_50M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,876 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_IPVPN_20M_50M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,913 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_IPVPN_20M_50M.yml inventory source with yaml plugin
2020-02-20 14:37:56,914 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,914 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_IPVPN_8M_10M_200M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,914 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_IPVPN_8M_10M_200M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,970 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_IPVPN_8M_10M_200M.yml inventory source with yaml plugin
2020-02-20 14:37:56,971 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,971 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_SoM_10M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,971 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_SoM_10M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,974 p=ansible u=123991 | Skipping empty key (hosts) in group (snif_router_SoM_10M)
2020-02-20 14:37:56,975 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_SoM_10M.yml inventory source with yaml plugin
2020-02-20 14:37:56,975 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,975 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_SoM_20M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,975 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_SoM_20M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,978 p=ansible u=123991 | Skipping empty key (hosts) in group (SNIF_SOM_20M)
2020-02-20 14:37:56,978 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_SoM_20M.yml inventory source with yaml plugin
2020-02-20 14:37:56,978 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,979 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_SoM_40M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,979 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_SoM_40M.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,982 p=ansible u=123991 | Skipping empty key (hosts) in group (snif_router_SoM_40M)
2020-02-20 14:37:56,982 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_SoM_40M.yml inventory source with yaml plugin
2020-02-20 14:37:56,983 p=ansible u=123991 | setting up inventory plugins
2020-02-20 14:37:56,983 p=ansible u=123991 | host_list declined parsing /etc/ansible/inventory/snif_router_all.yml as it did not pass its verify_file() method
2020-02-20 14:37:56,983 p=ansible u=123991 | script declined parsing /etc/ansible/inventory/snif_router_all.yml as it did not pass its verify_file() method
2020-02-20 14:37:57,057 p=ansible u=123991 | Parsed /etc/ansible/inventory/snif_router_all.yml inventory source with yaml plugin
2020-02-20 14:37:57,074 p=ansible u=123991 | Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc
2020-02-20 14:37:57,243 p=ansible u=123991 | META: ran handlers
2020-02-20 14:37:57,299 p=ansible u=123999 | <dhcp-test> ESTABLISH SSH CONNECTION FOR USER: ansible
2020-02-20 14:37:57,301 p=ansible u=123999 | <dhcp-test> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=password -o PasswordAuthentication=yes -o StrictHostKeyChecking=no -o 'UserKnownHostsFile=~/.ssh/known_hosts' -o StrictHostKeyChecking=no -o 'IdentityFile="/home/ansible/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/home/ansible/.ansible/cp/eb7ca3ea78 dhcp-test '/bin/sh -c '"'"'echo ~ansible && sleep 0'"'"''
2020-02-20 14:37:57,330 p=ansible u=123999 | <dhcp-test> (1'''OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 123960\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\nThe system cannot find the path specified.\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n')
2020-02-20 14:37:57,331 p=ansible u=123999 | <dhcp-test> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 123960
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
The system cannot find the path specified.
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
2020-02-20 14:37:57,331 p=ansible u=123999 | <dhcp-test> ESTABLISH SSH CONNECTION FOR USER: ansible
2020-02-20 14:37:57,333 p=ansible u=123999 | <dhcp-test> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=password -o PasswordAuthentication=yes -o StrictHostKeyChecking=no -o 'UserKnownHostsFile=~/.ssh/known_hosts' -o StrictHostKeyChecking=no -o 'IdentityFile="/home/ansible/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/home/ansible/.ansible/cp/eb7ca3ea78 dhcp-test '/bin/sh -c '"'"'echo "`pwd`" && sleep 0'"'"''
2020-02-20 14:37:57,362 p=ansible u=123999 | <dhcp-test> (1'''OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 123960\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\nThe system cannot find the path specified.\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n')
2020-02-20 14:37:57,362 p=ansible u=123999 | <dhcp-test> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 123960
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
The system cannot find the path specified.
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
2020-02-20 14:37:57,362 p=ansible u=123999 | <dhcp-test> ESTABLISH SSH CONNECTION FOR USER: ansible
2020-02-20 14:37:57,364 p=ansible u=123999 | <dhcp-test> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=password -o PasswordAuthentication=yes -o StrictHostKeyChecking=no -o 'UserKnownHostsFile=~/.ssh/known_hosts' -o StrictHostKeyChecking=no -o 'IdentityFile="/home/ansible/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/home/ansible/.ansible/cp/eb7ca3ea78 dhcp-test '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1582202277.3-115200326942742 `" && echo ansible-tmp-1582202277.3-115200326942742="` echo ~/.ansible/tmp/ansible-tmp-1582202277.3-115200326942742 `" ) && sleep 0'"'"''
2020-02-20 14:37:57,391 p=ansible u=123999 | <dhcp-test> (1'''OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 123960\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\nThe system cannot find the path specified.\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n')
2020-02-20 14:37:57,391 p=ansible u=123999 | <dhcp-test> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 123960
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
The system cannot find the path specified.
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
2020-02-20 14:37:57,397 p=ansible u=123991 | dhcp-test | UNREACHABLE! => {
    "changed"false
    "msg""Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp/ansible-tmp-1582202277.3-115200326942742 `\" && echo ansible-tmp-1582202277.3-115200326942742=\"` echo ~/.ansible/tmp/ansible-tmp-1582202277.3-115200326942742 `\" ), exited with result 1, stderr output: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 123960\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\nThe system cannot find the path specified.\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n"
    "unreachable"true
}


Its important to say that on the Windows host side I have ssh installed and I can SSH with no problem from my ansible linux machine and get the powershell cli.



Any ideas? why isn't it working?



David Foley

unread,
Feb 20, 2020, 7:57:22 AM2/20/20
to Ansible Project
Did you check your Firewall to make sure icmp is opened or allowed  ?
i'll create a simple playbook create new folder on the windows host for the connection i'll use ssh instead of WINRM since you have ssh installed 

Yehuda Pinhas

unread,
Feb 20, 2020, 8:49:36 AM2/20/20
to Ansible Project
Hi Thanks for your answer.

Thanks to you my problem is solved.


I had to install certificate in the windows host side and then use ntlm transport and ignore cert_validation.

These made it work.
Reply all
Reply to author
Forward
0 new messages