2016-10-25 8 views
0

msiファイルを入れるにはC:\MSIフォルダを作成する必要があります。Windowsノードで可能です - ディレクトリを作成する方法

tasks: 
    - name: Copy *.msi files from ./MSI to C:\MSI 
    file: path=C:\MSI state=directory 

しかし、私はエラーました:ここに私のタスクがある

TASK [Copy *.msi files from ./MSI to C:\MSI] *********************************** 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: + ~~~~~~~~~~~~~~~ 
fatal: [agentsmith]: FAILED! => {"changed": false, "failed": true, "msg": "The term '/usr/bin/python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."} 

をして冗長モードで私はいくつかの理由でファイルモジュールは、PowerShellスクリプトに/usr/bin/pythonを置くことを参照してください。

TASK [Copy *.msi files from ./MSI to C:\MSI] *********************************** 
task path: /home/qaexpert/ansible-lab/tcagent.yml:8 
<agentsmith> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO agentsmith 
<agentsmith> EXEC Set-StrictMode -Version Latest 
(New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1477410445.62-187863101456896").FullName | Write-Host -Separator ''; 
<agentsmith> PUT "/tmp/tmpqOJYen" TO "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1477410445.62-187863101456896\file.ps1" 
<agentsmith> EXEC Set-StrictMode -Version Latest 
Try 
{ 
/usr/bin/python 'C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1477410445.62-187863101456896\file.ps1' 
} 
Catch 
... 

答えて

3

モジュールがPythonをターゲットシステムにインストールする必要があるため、/usr/bin/pythonを探すことができません。 は通常のを使用することはできません。

詳細はAnsible Windows documentationをご覧ください。 Windowsホストでは、“windows” subcategory of the Ansible module indexにリストされているモジュールのみが使用可能です。

通常のfileモジュールを交換するには、win_fileモジュールを使用します。

関連する問題