Ansible 无法使用 UNC Choco 源安装 Chocolatey 包。

问题描述 投票:0回答:1

Ansible Version: 2.4.2.0

Ansible Control: Centos7

Target Hosts: Windows 2012R2

我有一个名为的文件服务器。FILESERVER 我把所有的 chocolatey 文件夹中的包 C:\Packages. 而且这个文件夹是共享的,所以其他服务器可以通过UNC路径访问这个文件夹。\\FILESERVER\Packages.

如果我登录到其中一台机器并运行。

choco install 7zip -y -s \\FILESERVER\Packages

它就会进入那个文件服务器并安装这个包。然而,如果我尝试通过 Ansible 它说Choco Source中不存在这个包。

---
- hosts: win
  tasks:
    - name: chocolatey-core.extension
      win_chocolatey:
        name: chocolatey-core.extension
        state: present
        source: \\FILESERVER\Packages

错误。

fatal: [mdb]: FAILED! => {"changed": false, "choco_error_cmd": "choco.exe install -r --no-progress -y chocolatey-core.extension --timeout 2700 --failonunfound --source \\\\FILESERVER\\Packages", "choco_error_log": ["Installing the following packages:", "chocolatey-core.extension", "By installing you accept licenses for the packages.", "chocolatey-core.extension not installed. The package was not found with the source(s) listed.", " Source(s): '\\\\FILESERVER\\Packages'", " NOTE: When you specify explicit sources, it overrides default sources.", "If the package version is a prerelease and you didn't specify `--pre`,", " the package may not be found.", "Please see http s://chocolatey.org/docs/troubleshooting for more ", " assistance.", "","Chocolatey installed 0/1 packages. 1 packages failed.", " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).", "", "Failures", " - chocolatey-core.extension - chocolatey-coree.extension not installed. The package was not found with the source(s) listed.", " Source(s): '\\\\FILESERVER\\Packages'", " NOTE: When you specify explicit sources, it overrides default sources.", "If the package version is a prerelease and you didn't specify `--pre `,", " the package may not be found.", "Please see https://chocolatey.org/docs/troubleshooting for more ", " assistance."], "command": "choco.exe install -r --no-progress -y chocolatey-core.extension --timeout 2700 --failonunfound --source \\\\FILESERVER\\Packages", "msg": "Error installing package 'chocolatey-core.extension'", "rc": 1, "stdout": "Installing the following packages:\r\nchocolatey-core.extension\r\nBy installing you accept licenses for the packages.\r\nchocolatey-core.extension not installed. The package was not found with the source(s) listed.\r\n Source(s): \\\\FILESERVER\\Packages'\r\n NOTE: When you specify explicit sources, it overrides default sources.\r\nIf the package version is a prerelease and you didn't specify `--pre`,\r\n the package may not be found.\r\nPlease see https://chocolatey.org/docs/troubleshooting for more \r\n assistance.\r\n\r\nChocolatey installed 0/1 packages. 1 packages failed.\r\n See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).\r\n\r\nFailures\r\n - chocolatey-core.extension - chocolatey-core.extension not installed. The package was not found with the source(s) listed.\r\n Source(s): '\\\\FILESERVER\\Packages'\r\n NOTE: When you specify explicit sources, it overrides default sources.\r\nIf the package version is a prerelease and you didn't specify `--pre`,\r\n the package may not be found.\r\nPlease see https://chocolatey.org/docs/troubleshooting for more \r\n assistance.\r\n", "stdout_lines": ["Installing the following packages:", "chocolatey-core.extension", "By installing you accept licenses for the packages.", "chocolatey-core.extension not installed. The package was not found with the source(s) listed.", " Source(s): '\\\\FILESERVER\\Packages'", " NOTE: When you specify explicit sources, it overrides default sources.", "If the package version is a prerelease and you didn't specify `--pre`,", " the package may not be found.", "Please see https://chocolatey.org/docs/troubleshooting for more ", " assistance.", "","Chocolatey installed 0/1 packages. 1 packages failed.", " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).", "", "Failures", " - chocolatey-core.extension - chocolatey-core.extension not installed. The package was not found with the source(s) listed.", " Source(s): '\\\\FILESERVER\\Packages'", " NOTE: When you specify explicit sources, it overrides default sources.", "If the package version is a prerelease and you didn't specify `--pre`,", " the package may not be found.", "Please see https://chocolatey.org/docs/troubleshooting for more ", " assistance."]}

我不知道ansible的错误信息是否与... \\\\Fileserver\\Package 还是说它实际上使用的是那个 \\\\FileServer\\Packages 作为实际的Choco源?

windows ansible chocolatey
1个回答
0
投票

这可能是通过WinRM的ansible不能访问网络共享,因为它运行在不同的上下文中。

请看 https:/docs.ansible.comansiblelatestuser_guidewindows_winrm.html#limitations。 为限制。

© www.soinside.com 2019 - 2024. All rights reserved.