Package Management on Windows gets even better with Chocolatey

Many of you are already using Chocolatey, the definitive package manager to install and configure software in your Windows environments. You’ve asked for a supported Chocolatey module for a while, and this is our first step towards providing one. Today, we’re announcing the release of a new Chocolatey module; this first version of the Puppet Chocolatey module is a public preview, to gather feedback. We plan to release the new Puppet Chocolatey module as a fully supported module in September.

The Chocolatey module allows you to install and configure Chocolatey and manage Chocolatey packages. With the Chocolatey package provider you get the benefit of:

  • Managing software across all of your Puppet-enabled Windows nodes.

  • Managing the installation of Chocolatey itself on those nodes without requiring any external network access.

  • Completely configuring Chocolatey and managing sources for packages. Some configuration features are in the public preview release, and all will be supported by the time the module reaches Supported status.

Our new Chocolatey module includes the following features:

  • Installing Packages - Make Chocolatey your default package provider and install over 4,000 community-maintained packages.

  • New provider for Chocolatey sources - Specify a folder, CIFS share, NuGet HTTP OData feed, or even a full Package Gallery as a source for your packages.

  • New provider for Chocolatey features - Enable or disable Chocolatey features to auto-confirm prompts, use a private download cache, or even perform virus checking on downloaded files (some features may require licensed versions of Chocolatey).

To get started with the Chocolatey module, first install the module:

puppet module install puppetlabs-chocolatey

Next, create a manifest called chocolatey.pp and add the following to it:

include chocolatey

package { 'notepadplusplus':
  ensure   => installed,
  provider => chocolatey,
  source   => “C:\\local\\folder\\packages”,
}

Don’t want to use the community installation of Chocolatey? Install it from your own Chocolatey nupkg instead:

class {'chocolatey':
  chocolatey_download_url         => 'file:///c:/location/of/chocolatey.0.9.9.9.nupkg',
  use_7zip                        => false,
  choco_install_timeout_seconds   => 2700,
}

Now, apply the manifest:

puppet apply c:\path\to\chocolatey.pp

Your output may look similar to what you see below:

Notice: Compiled catalog for win2012r2x64 in environment production in 0.58 seconds
Notice: /Stage[main]/Chocolatey::Install/Windows_env[chocolatey_PATH_env]/ensure : created
Notice: /Stage[main]/Chocolatey::Install/Windows_env[chocolatey_ChocolateyInstall_env]/ensure: created
Notice: /Stage[main]/Chocolatey::Install/Exec[install_chocolatey_official]/returns: executed successfully
Notice: /Stage[main]/Chocolatey::Install/Exec[install_chocolatey_official]: Triggered 'refresh' from 2 events
Notice: /Stage[main]/Main/Package[notepadplusplus]/ensure: created
Notice: Finished catalog run in 35.22 seconds

That’s it!

We’re looking for your feedback on the Chocolatey module. If you have an issue, create a ticket, or if you just want to chat, find us on Slack in the #windows channel.

Learn more

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