Ansible win_chocolatey 模块-System.OutOfMemoryException 错误

Ansible win_chocolatey 模块-System.OutOfMemoryException 错误

我正在尝试使用 Ansible 通过 win_chocolatey 模块在 Windows Server 2008 R2 上安装软件。它不起作用,因为它会抛出错误:

[错误] - Chocolatey 在 WIN-2008r2(用户管理员)上出现错误:System.OutOfMemoryException:引发了类型为“System.OutOfMemoryException”的异常。在 System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IRuntimeMethodInfo 方法)在 System.Reflection.Emit.DynamicMethod.CreateDelegate(类型 delegateType,对象目标)在 System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda,DebugInfoGenerator debugInfoGenerator)在 System.Management.Automation.Interpreter.LoopCompiler.CreateDelegate()在 System.Management.Automation.Interpreter.EnterLoopInstruction.Compile(对象 frameObj)在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executiveContext,ContextCallback 回调,对象状态,布尔型 retainSyncCtx)在 System.Threading.ExecutionContext.Run(ExecutionContext executiveContext,ContextCallback 回调,对象状态,布尔型 retainSyncCtx)在System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() 在 System.Threading.ThreadPoolWorkQueue.Dispatch()

命令“choco install”在服务器上使用时有效。

我尝试增加 PowerShell 和 WinRM 的内存限制。

设置项目 wsman:localhost\Shell\MaxMemoryPerShellMB 2048

winrm 设置 winrm/config/winrs'@{MaxMemoryPerShellMB="2048"}'

还有什么问题?

答案1

相关内容