homeblogpuppet supported module chocolatey

Puppet Supported module for Chocolatey

At Puppet, we’ve been working on a supported Chocolatey module that will provide more support and stability than what you may find in the approved Chocolatey module. The current plan is that the Puppet Approved chocolatey/chocolatey module will continue to exist in parallel with the Puppet Supported module, but may move at a more rapid release rate and have less stability. The Chocolatey team has worked with Puppet to create the Puppet Supported module for customers who need both stability and support from Puppet for the Chocolatey provider.

There have been some major improvements with the Chocolatey module. Most notable is complete control over your Chocolatey configuration with Puppet.

The Puppet Chocolatey provider now has chocolateyconfg, chocolateyfeature, and chocolateysource custom resource types. These types work during the same run where you ensure Chocolatey is installed. We think you are going to love the ability to lock down your configuration immediately to use your internal sources and set other features, really setting up Chocolatey to your custom sweet tooth!

Let’s see how we use Puppet to disable the default community repository and add our own source:

We've disabled the default community repository and set the priority of our internal server (internal_chocolatey above) to 1, which is the highest priority. If we configure any additional sources later at a lower priority or no priority (0), then Chocolatey will search this source for packages prior to any other source. To learn more about sources, see Source Command and How To Host Your Own Package Server. You can also read Chocolatey: Hosting your own server.

Set configuration

Now let’s set some configuration and options.

To see the full list of items you can use with chocolateyconfig, try running choco config list or puppet resource chocolateyconfig. For features, use choco feature list or puppet resource chocolateyfeature.

Mix In business edition for major sweetness

Most people start with the open source version of Chocolatey. Typically organizations that are serious about Chocolatey integrate with the business edition to take advantage of Package Builder, Package Internalizer, Package Synchronizer, etc. Let’s say we have Chocolatey for Business and we want to keep everything internal, including the updates to the licensed edition extension package.

We'll need to download the latest version of the licensed edition and put it on our internal server. Let's run the following commands:

  • choco download chocolatey.extension -u customer -p <licenseIdGuidFromLicenseFile> -s "'https://licensedpackages.chocolatey.org/api/v2;https://chocolatey.org/api/v2'"
  • choco push chocolatey.extension.1.7.0.nupkg -s http://internal/server

Now once we have the licensed extension on our internal package server, we'll need to do the following:

This sets our license file from a module named internal, then disables the licensed source and instead installs the licensed extension from our internal source.

Put it all together

Let’s see what a complete solution for Chocolatey looks like, including setting up an internal package repository to host packages on.

We've set up an entire infrastructure, and installed some software to boot.

Give it a shot!

We are excited about the supported Chocolatey module release, and believe you will be as well. From controlling your entire Chocolatey configuration to complete control over your software management infrastructure, you won't know how you managed software on Windows before Puppet and Chocolatey!

Rob is a senior software engineer at Puppet.

Learn more

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.