Windows machine not pinging.

ICMP protocol is emabled on remote machine.
Remote desktop is also enabled.
winrm and enable-psremoting also enabled

Ran, below commands also.
winrm set winrm/config/client/auth ‘@{Basic=“true”}’
winrm set winrm/config/service/auth ‘@{Basic=“true”}’

Able to ping the remote windows serer 2019 machine from ansible server ubuntu machine.

But when I ran a ping test, win_ping from ansible, getting below error.

adminuser@ansible-server:~/Desktop/DM$ ansible windows -m win_ping -vvv -i inventory.yml
ansible 2.9.12
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/home/adminuser/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 9.2.1 20191008]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /home/adminuser/Desktop/DM/inventory.yml as it did not pass its verify_file() method
script declined parsing /home/adminuser/Desktop/DM/inventory.yml as it did not pass its verify_file() method
Parsed /home/adminuser/Desktop/DM/inventory.yml inventory source with ini plugin
META: ran handlers
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_ping.ps1
Pipelining is enabled.
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm installed?)
<10.1.85.246> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5985 TO 10.1.85.246
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_ping.ps1
Pipelining is enabled.
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm installed?)
<10.1.85.236> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5985 TO 10.1.85.236
build-machine3 | UNREACHABLE! => {
“changed”: false,
“msg”: “ntlm: the specified credentials were rejected by the server”,
“unreachable”: true
}
EXEC (via pipeline wrapper)
build-machine2 | SUCCESS => {
“changed”: false,
“invocation”: {
“module_args”: {
“data”: “pong”
}
},
“ping”: “pong”
}
META: ran handlers
META: ran handlers

On build-machine2 everything is open, firewall disabled.
But on build-machine3 this problem occured but ICMP all protocols enabled and winrm also.

The ping and win_ping modules aren’t doing an ICMP ping, they are checking to see if Ansible can connect to the host and execute a very basic module. In your case it’s able to connect to the host but it’s enable to authenticate using the credentials you have specified. See https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#http-401-credentials-rejected for a list of reasons why it might be rejecting your credentials.

But the credentials are correct.

You are using domain account or local account?

Vào Th 2, 12 thg 10, 2020 vào lúc 17:18 uday kiran <uday1kiran@gmail.com> đã viết: