vishwas gautam
vishwas gautam

Reputation: 69

Ansible: "msg": "basic: Bad HTTP response returned from server. Code 503"

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

Answers (3)

nwoko tochukwu
nwoko tochukwu

Reputation: 51

I had this same error.
The problem turned out to be proxy.
just run export http_proxy="".

Upvotes: 5

belfast77
belfast77

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

Ramakrishna Yelduti
Ramakrishna Yelduti

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

Related Questions