4

I am attempting to use Chocolatey ( http://chocolatey.org ) as a package provider for Puppet, but I continually get this error when running the Puppet agent on my Win 7 box.

info: Caching catalog for ldap-windows-vm.localdomain
err: Failed to apply catalog: Parameter provider failed: Invalid package provide
r 'chocolatey' at /etc/puppet/environments/beta/modules/stormaas/manifests/init.
pp:9

I've placed this module, https://github.com/rismoney/puppet-chocolatey, in my modules/ directory on my Puppet master, I have pluginsync set to true on both the master and slave - and am already using a few imported types that are working with the same setup.

Calling the package with:

  package { 'stormaas':
    ensure   => installed,
    provider => 'chocolatey',
  }

I've tried with both the provider set to 'chocolatey' and chocolatey in case it was a quotes issue, and restarted both the master and slave on every change and ran the agent multiple times to ensure it was refreshed.

All other aspects of the module that is being applied to the machine works - just not this.

Any thoughts?

TJ Biddle
  • 161
  • 1
  • 6

2 Answers2

2

This looks to be a Puppet bug actually - I'm using dynamic environments, so my module was originally placed under /etc/puppet/environments/beta/chocolatey/ but when I moved the module over to /etc/puppet/modules then it worked.

What's interesting is custom types worked fine while in the environment - but custom providers failed to sync up.

The module works great it seems - Might be a few quirks, if I run into any I'll patch it and submit a pull request.

TJ Biddle
  • 161
  • 1
  • 6
  • I have some updates to this, I'll post in a new answer though as it is a completely different idea than what this originally stated. – ferventcoder Sep 10 '15 at 13:39
1

Once you get past the issues with modulepath, here is some more information related to other issues that could crop up and how to resolve them.

The Chocolatey provider (now located at chocolatey/chocolatey), requires Chocolatey itself to be installed. Since the release of v1.1.0, the provider will actually handle ensuring Chocolatey is installed. You just need to add the following somewhere in your manifests:

include chocolatey

If you want to get into more scenarios related to the chocolatey class, you can see the available parameters in the ReadMe. Example included:

class {'chocolatey':
  chocolatey_download_url => 'https://internalurl/to/chocolatey.nupkg',
  choco_install_location => 'D:\secured\choco',
  use_7zip => false,
  choco_install_timeout => 2700,
  enable_autouninstaller => true,
}
ferventcoder
  • 347
  • 3
  • 4
  • 12