I am trying to ping windows host from using ansible, but unable to ping.
getting below errors:
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "#< CLIXML\r\n<Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"><S S=\"Error\">invalid payload_x000D__x000A_</S><S S=\"Error\">At line:4 char:44_x000D__x000A_</S><S S=\"Error\">+ If (-not $split_parts.Length -eq 2) { throw <<<< \"invalid payload\" }_x000D__x000A_</S><S S=\"Error\"> + CategoryInfo : OperationStopped: (invalid payload:String) [], R _x000D__x000A_</S><S S=\"Error\"> untimeException_x000D__x000A_</S><S S=\"Error\"> + FullyQualifiedErrorId : invalid payload_x000D__x000A_</S><S S=\"Error\"> _x000D__x000A_</S></Objs>",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Inventory file:
[winnode]
localhost
group_vars:
ansible_port: 5985
ansible_connection: winrm
ansible_user: XXXXX
ansible_password: XXXXXX
ansible_winrm_scheme: http
ansible_winrm_kerberos_delegation: true
Playbook.yml:
- hosts: winnode
gather_facts: no
tasks:
- name: "ping host"
win_ping:
register: download_result
- name: "display result"
debug:
var: download_result
By using win_rm
I am trying to access playbook in windows, but I am getting issues.
telnet is working for post 5985, able to connect telnet, but by using ansible unable to connect and get the result of ping command.