git的Choco安装与ansible不兼容,如何修复?

git的Choco安装与ansible不兼容,如何修复?,git,ansible,Git,Ansible,我在ansible的剧本中使用了以下任务 win_chocolatey: name: git state: present package_params: '/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs' 当我第一次运行但未安装在目标计算机上时,它显示为已更改。 第二次显示状态为ok。 但两次都没有安装git。 吉特巧克力 下面是正常的choco命令 choco install git

我在ansible的剧本中使用了以下任务

win_chocolatey:
    name: git
    state: present
    package_params: '/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs'
当我第一次运行但未安装在目标计算机上时,它显示为已更改。 第二次显示状态为ok。 但两次都没有安装git。 吉特巧克力

下面是正常的choco命令

choco install git.install --params "/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs"
使用fresh machine时,它正在工作,但如果我将状态更改为缺席,则它不会卸载,我将收到此错误

  TASK [Install git] *********************************************************************************
fatal: [build-machine2]: FAILED! => {"changed": false, "command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe uninstall git.install --yes --no-progress --limit-output --package-params \"/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs\" --timeout 2700 --all-versions", "msg": "Error uninstalling package(s) 'git.install'", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "Uninstalling the following packages:\r\ngit.install;/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs\r\n\r\ngit.install v2.28.0\r\n Running auto uninstaller...\r\n Auto uninstaller has successfully uninstalled git.install or detected previous uninstall.\r\n git.install has been successfully uninstalled.\r\n\r\nChocolatey uninstalled 0/0 packages. \r\n See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).\r\nSecond path fragment must not be a drive or UNC name.\r\nParameter name: path2\r\n", "stdout_lines": ["Uninstalling the following packages:", "git.install;/GitAndUnixToolsOnPath /NoAutoCrlf /NoCredentialManager /NoGitLfs", "", "git.install v2.28.0", " Running auto uninstaller...", " Auto uninstaller has successfully uninstalled git.install or detected previous uninstall.", " git.install has been successfully uninstalled.", "", "Chocolatey uninstalled 0/0 packages. ", " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).", "Second path fragment must not be a drive or UNC name.", "Parameter name: path2"]}
然后我使用choco uninstall从机器上运行uninstall,每次都会收到这个ok消息。 看来,巧克力没有被正确处理