Ansible Windows 解压缩模块失败,如何修复?

Ansible Windows 解压缩模块失败,如何修复?

我的任务是剧本的一部分。

- name: unzip maven
     win_unzip:
       src: C:\tools\maven.zip
       dest: C:\tools\maven
       recurse: yes
       delete_archive: yes

输出:

TASK [unzip maven] *******************************************************************************************
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm
installed?)
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm
installed?)
fatal: [build-machine3]: FAILED! => {"changed": false, "dest": "C:\\tools\\maven", "msg": "PowerShellCommunityExtensions PowerShell Module (PSCX) is required for non-'.zip' compressed archive types.", "removed": false, "src": "C:\\tools\\maven.zip"}
fatal: [build-machine2]: FAILED! => {"changed": false, "dest": "C:\\tools\\maven", "msg": "PowerShellCommunityExtensions PowerShell Module (PSCX) is required for non-'.zip' compressed archive types.", "removed": false, "src": "C:\\tools\\maven.zip"}

因此在它前面添加了 PSCX 部分。

- name: Install PSCX
     win_psmodule:
       name: Pscx
       state: present

但是,现在出现与 Pscx 相关的以下错误。

TASK [Install PSCX] ******************************************************************************************
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm
installed?)
[WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date version of pywinrm
installed?)
fatal: [build-machine3]: FAILED! => {"changed": false, "msg": "Problems installing Pscx module: The following commands are already available on this system:'gcb,Expand-Archive,Format-Hex,Get-Hash,help,prompt,Get-Clipboard,Get-Help,Set-Clipboard'. This module 'Pscx' may override the existing commands. If you still want to install this module 'Pscx', use -AllowClobber parameter.", "nuget_changed": false, "output": "", "repository_changed": false}
fatal: [build-machine2]: FAILED! => {"changed": false, "msg": "Problems installing Pscx module: The following commands are already available on this system:'gcb,Expand-Archive,Format-Hex,Get-Hash,help,prompt,Get-Clipboard,Get-Help,Set-Clipboard'. This module 'Pscx' may override the existing commands. If you still want to install this module 'Pscx', use -AllowClobber parameter.", "nuget_changed": false, "output": "", "repository_changed": false}

请提出建议。

我首先将这个问题添加到 stackoverflow 但是它在那里被关闭了并将我重定向到这里。

相关内容