我通过ansible连接到Windows主机。但是我从win_shell得到一个错误。

   [as_user@tt ansible-winconnect]$ ansible-playbook -i WIN win_conn.yml -t echo_test --ask-pass -vvvv
    fatal: [x.x.x.x]: FAILED! => {
        "changed": true,
        "cmd": "echo %HOMEDIR% > print.txt",
        "delta": "0:00:00.287028",
        "end": "2017-05-25 11:38:05.603907",
        "failed": true,
        "rc": 1,
        "start": "2017-05-25 11:38:05.316878",
        "stderr": "Thread failed to start.\r\n",
        "stderr_lines": [
            "Thread failed to start."
        ],
        "stdout": "",
        "stdout_lines": []
    }

    [as_user@tt ansible-winconnect]$ cat win-conn/tasks/main.yml
    ---
    - name: Print Home Dir in a file
      win_shell: echo %HOMEDIR% > print.txt
      tags: echo_test

最佳答案

假设您拥有Powershell 3+,并且遵循了Ansible docs,您可能会遇到内存不足的问题。据微软



WinRM创建的 shell 程序可能没有足够的内存来运行Ansible试图通过WinRM运行的Powershell。

尝试使用Microsoft https://support.microsoft.com/en-us/help/2842230/out-of-memory-error-on-a-computer-that-has-a-customized-maxmemorypersh的以下修补程序

关于linux - ansible 2.3>在Windows主机上检查时出现错误: Thread failed to start,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44179900/

10-11 22:13
查看更多