# Using a windows file share as a source in win\_chocolatey.

**URL:** <https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 4, 2017, 10:29am UTC](https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889 "2017-07-04T10:29:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Reid](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@Nicholas\_Reid](https://forum.ansible.com/u/Nicholas_Reid)\
**Post date:** [July 4, 2017, 10:29am UTC](https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889/1 "2017-07-04T10:29:36Z")

</div>

Hi All,

Really excited to have discovered this group. Looking forward to being an active member.

I’ve just got going on ansible to manage some windows workstations. I’m attempting to use the win\_chocolatey module to manage my installs.  
Does anyone know if it’s possible to use a UNC path to a windows file share as the source of the packages.

For example:

- name: Install Packages  
win\_chocolatey:  
name: “{{ item.name }}”  
source: “{{ item.source }}”  
state: present  
with\_items:
- { name: “package1”, source: ‘\fileserver\Installs\package1.nupkg’ }
- { name: “package2”, source: ‘\fileserver\Installs\package2.nupkg’ }

When running the above (and many different permutations) I get the below error:  
“msg”: “Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"”}

I have ensured the account i’m running the playbook with has a kerberos ticket using kinit and can connect to both the machine being managed and the fileshare, and has the correct NTFS/share permissions.

I would have though as win\_chocolatey relies on winRM that connecting to windows file shares was possible but want to confirm.

Thanks in advance.

Nick

---

<div class="post-metadata">

**Author:** ![Mike\_Fennemore](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Mike\_Fennemore](https://forum.ansible.com/u/Mike_Fennemore)\
**Post date:** [July 6, 2017, 7:23am UTC](https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889/2 "2017-07-06T07:23:51Z")

</div>

I don’t think that’s possible unfortunately with the module as it will attempt to download the files over HTTP.

---

<div class="post-metadata">

**Author:** ![Mike\_Fennemore](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Mike\_Fennemore](https://forum.ansible.com/u/Mike_Fennemore)\
**Post date:** [July 6, 2017, 8:16am UTC](https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889/3 "2017-07-06T08:16:48Z")

</div>

[https://chocolatey.org/docs/how-to-set-up-chocolatey-server](https://chocolatey.org/docs/how-to-set-up-chocolatey-server) this might be more usable as the source of packages.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 6, 2017, 2:31pm UTC](https://forum.ansible.com/t/using-a-windows-file-share-as-a-source-in-win-chocolatey/24889/4 "2017-07-06T14:31:58Z")

</div>

Yeah the module doesn’t currently pick up from shares, a private chocolately server is probably the easiest way to fix that.

Worth adding that if you want to pick up files from shares for other reasons you should enable kerberos auth delegation so that you can access files from the share as this is a second hop scenario. Its documented at the bottom of this section [http://docs.ansible.com/ansible/intro\_windows.html#inventory](http://docs.ansible.com/ansible/intro_windows.html#inventory)

Jon
