1

我正在为 ansible 启用 windows 节点。为此,我使用以下命令在 Windows 7 中启用 http 和 https 远程会话。

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

我在办公室收到以下错误。

你能帮我解决这个问题吗?

在家里的另一台笔记本电脑上它工作正常。

+     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.

我尝试了以下选项:

set http_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/
set https_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/

set http_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/
set https_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/

set HTTP_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/
set HTTPS_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/

set HTTP_PROXY=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/
set HTTPS_PROXY=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/ 

我尝试了以上所有细节......仍然无法正常工作

更新:

似乎,连接已创建(登录)。我在 Windows 机器中观察到以下事件日志

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.

提前致谢。

4

1 回答 1

1

你可能在代理后面。如果是这样,请先尝试设置您的代理:

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

或者您可以转到您的Control Panel->Internet Options->Connections->LAN Settings->Proxy servers.

全部一起:

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'))"
于 2017-11-07T08:39:34.163 回答