gpt4 book ai didi

linux - 在 Linux 上从 Ansible 连接 winrm 模块

转载 作者:太空宇宙 更新时间:2023-11-04 03:44:40 25 4
gpt4 key购买 nike

我正在使用 Linux 上托管的 ansible 来管理 azure 上的 Linux 和 Windows VM。当我尝试使用

从 ansible ping Windows 虚拟机时
# ansible windows -m win_ping

我收到以下错误:

test-windows.cloudapp.net | FAILED >> {
"failed": true,
"msg": "The term 'ConvertFrom-Json' is not recognized as the name of a cmdlet, function\r\n, script file, or operable program. Check the spelling of the name, or if a pat\r\nh was included, verify that the path is correct and try again.\r\nAt C:\\Users\\coremedia\\AppData\\Local\\Temp\\ansible-tmp-1424263716.9-1357614051035\r\n00\\win_ping.ps1:54 char:67\r\n+ $parameters = Get-Content $arguments[0] | ConvertFrom-Json <<<< ;\r\n + CategoryInfo : ObjectNotFound: (ConvertFrom-Json:String) [], Co \r\n mmandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nThe term 'ConvertTo-Json' is not recognized as the name of a cmdlet, function, \r\nscript file, or operable program. Check the spelling of the name, or if a path \r\nwas included, verify that the path is correct and try again.\r\nAt C:\\Users\\coremedia\\AppData\\Local\\Temp\\ansible-tmp-1424263716.9-1357614051035\r\n00\\win_ping.ps1:85 char:31\r\n+ echo $obj | ConvertTo-Json <<<< -Depth 99\r\n + CategoryInfo : ObjectNotFound: (ConvertTo-Json:String) [], Comm \r\n andNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\n",
"parsed": false

}

Windows机器安装了Powershell 4。

有什么想法吗?

最佳答案

这是我的错误,Windows Server 2008 中默认安装了 Powershell 2.0,升级到 Powershell 3 解决了 ping 问题。但是还有一个问题叫做“进程由于堆栈溢出异常而终止”,解决方案在下面的论坛中讨论了

https://groups.google.com/forum/#!topic/ansible-project/Rpvuidq5XeA

关于linux - 在 Linux 上从 Ansible 连接 winrm 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28584266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com