2017-05-25 53 views
0

我正在連接到Windows主機vaia ansible。但是,當我通過win_shell檢查它帶有錯誤。ansible 2.3>檢查Windows主機,錯誤:線程無法啓動

[[email protected] 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": [] 
    } 

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

回答

0

您是否知道您的主機正在使用哪個版本的powershell?嘗試升級到版本4或更高版本,並查看是否修復了錯誤。或者您也可以嘗試使用win_command或raw ansible模塊來運行該命令。