1

I am enabling windows node for ansible. For this I am enabling http and https remote session in windows 7 using below command.

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))"

I am getting the below error in office.

Could you please help me on this?

At home in another laptop it is working fine.

+     Throw "Unable to establish an HTTP or HTTPS remoting session."
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to estab...moting session.:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to establish an HTTP or HTTPS remoting session.

I tried with below options:

set http_proxy=http://lsl5kor:N%[email protected]:8080/
set https_proxy=http://lsl5kor:N%[email protected]:8080/

set http_proxy=http://lsl5kor:N@[email protected]:8080/
set https_proxy=http://lsl5kor:N@[email protected]:8080/

set HTTP_PROXY=http://lsl5kor:N@[email protected]:8080/
set HTTPS_PROXY=http://lsl5kor:N@[email protected]:8080/

set HTTP_PROXY=http://lsl5kor:N%[email protected]:8080/
set HTTPS_PROXY=http://lsl5kor:N%[email protected]:8080/ 

i tried with all above details ...stil not working

Update:

Seems, connection created(Logged in). I observed below event log in windows machine

The WinRM service has received an unsecure HTTP connection from hostname. 

 This is not a secure configuration. 

 User Action 
 Set AllowUnencrypted to False in WinRM configuration to ensure packets are encrypted on the wire.

Thanks in advance.

sri
  • 131
  • 1
  • 3
  • 10

1 Answers1

1

You could be behind a proxy. If so try setting your proxy first:

set http_proxy=IP:Port
set https_proxy=IP:Port

Or you can goto your Control Panel->Internet Options->Connections->LAN Settings->Proxy servers.

All together:

set http_proxy=IP:Port
set https_proxy=IP:Port

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))"
Gamma.X
  • 554
  • 4
  • 9