Using a windows file share as a source in win_chocolatey.

329 views
Skip to first unread message

Nicholas Reid

unread,
Jul 5, 2017, 6:54:11 PM7/5/17
to Ansible Project
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




Mike Fennemore

unread,
Jul 6, 2017, 3:23:51 AM7/6/17
to Ansible Project
I don't think that's possible unfortunately with the module as it will attempt to download the files over HTTP.

Mike Fennemore

unread,
Jul 6, 2017, 4:16:48 AM7/6/17
to Ansible Project
https://chocolatey.org/docs/how-to-set-up-chocolatey-server this might be more usable as the source of packages.


On Thursday, July 6, 2017 at 12:54:11 AM UTC+2, Nicholas Reid wrote:

J Hawkesworth

unread,
Jul 6, 2017, 10:31:58 AM7/6/17
to Ansible Project
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

Jon
Reply all
Reply to author
Forward
0 new messages