Reputation: 69
I have ansible version 2.4.2. Trying to integrate Ansible control machine (RHEL) with Windows. When I run the ping command :
ansible wmdev (hostname) -i hosts -m win_ping
Getting below error while connecting to windows machine:
wmdev | UNREACHABLE! => {
"changed": false,
"msg": "basic: Bad HTTP response returned from server. Code 503",
"unreachable": true
}
I am not sure what his error code means. I tried using Kerberos, Basic, ntlm. But no success. Please help.
Upvotes: 1
Views: 6468
Reputation: 51
I had this same error.
The problem turned out to be proxy.
just run export http_proxy=""
.
Upvotes: 5
Reputation: 21
This can also occur if you have http_poxy or HTTP_PROXY set as an environment variable in your linux session.
Upvotes: 2
Reputation: 447
Try to debug this issue using following methods.
--> manually ping the destination server ip address. if you are not able to reach then it should be network issue.
--> Verify you host file. It should have following vars to connect to windows machine:
ansible_user=<user>
ansible_password=<password>
ansible_connection=winrm
ansible_winrm_transport=basic
ansible_ssh_port=5985
--> winrm should be enabled on your windows machine.
--> target windows machine execution policy should not be unrestricted.
--> verify net firewall rule "Windows Remote Management (HTTP-In)", if not available set it.
Upvotes: 0