# win\_chocolatey issue

**URL:** <https://forum.ansible.com/t/win-chocolatey-issue/26151>\
**Category:** Ansible Project\
**Created:** [November 28, 2017, 2:57pm UTC](https://forum.ansible.com/t/win-chocolatey-issue/26151 "2017-11-28T14:57:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SurferL](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SurferL](https://forum.ansible.com/u/SurferL)\
**Post date:** [November 28, 2017, 2:57pm UTC](https://forum.ansible.com/t/win-chocolatey-issue/26151/1 "2017-11-28T14:57:15Z")

</div>

I’m not sure if this is a win\_chocolatey issue, or an issue with the maintainers of the chocolatey installation (using Ansible 2.4.1.0)

However, I’m having issues with installing git.install using win\_chocolatey (when I have a long list of chocolatey packages to install)…

> - name: win | Install chocolatey components
> 
> win\_chocolatey:
> 
> name: “{{ item.package\_name }}”
> 
> allow\_empty\_checksums: yes
> 
> with\_items: “{{ chocolately\_packages }}”
> 
> become\_method: runas

> chocolately\_packages:
> 
> - package\_name: git.install
> 
> - package\_name: visualstudio2017buildtools
> 
> - package\_name: visualstudio2017-workload-vctools

with the error being:

> vsphere: “Using Git LFS”,  
> vsphere: “Installing 64-bit git.install…”,  
> vsphere: “git.install has been installed.”,  
> vsphere: “VERBOSE: Trying local and machine (x32 & x64) Uninstall keys”,  
> vsphere: “VERBOSE: Retrieving all uninstall registry keys”,  
> vsphere: “VERBOSE: Trying Uninstall key property ‘InstallLocation’”,  
> vsphere: “git.install installed to ‘C:\Program Files\Git’”,  
> vsphere: “ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Access is denied”,  
> vsphere: " git.install can be automatically uninstalled.“,  
> vsphere: “Environment Vars (like PATH) have changed. Close/reopen your shell to”,  
> vsphere: " see the changes (or in powershell/cmd.exe just type `refreshenv`).”,  
> vsphere: “git.install not installed. An error occurred during installation:”,  
> vsphere: " Access to the path ‘C:\ProgramData\chocolatey\lib\git.install\tools\Git-2.15.0-64-bit.exe’ is denied.",  
> vsphere: “The process cannot access the file ‘C:\ProgramData\chocolatey\lib\git.install\.chocolateyPending’ because it is being used by another process.”  
> vsphere: ],  
> vsphere: “command”: “choco.exe install -v --no-progress -y git.install --timeout 2700 --failonunfound --allow-empty-checksums”,  
> vsphere: “failed”: true,  
> vsphere: “item”: {  
> vsphere: “package\_name”: “git.install”  
> vsphere: },  
> vsphere: “msg”: “Error installing package ‘git.install’”,  
> vsphere: “rc”: 1,

Is this an issue with the package itself or something to do with win\_chocolatey?

What’s weird is that it sometimes does work without any issues 1 out of 10 times…
