Integrates with everything

Integrates with everything

Chocolatey integrates with several infrastructure automation tools!

With most of these tools, the interface you would interact with Chocolatey would be through the tool or through the interfaces of the tool, like in scripts.

Summary

Chocolatey Integration Implementation with Common Configuration Managers

For common integrations, it’s handy to refer to the table below to know what configuration manager to choose. Most of the implementations below are written and managed by the companies behind the product. These implementations are typically open source and each part could be added by community contributions for those familiar with the code implementations. If you are unable to provide code implementations for adding necessary functionality to the integrations, we find it best if you create issues/tickets with those organizations if you are a customer as you will have more leverage into getting them implemented.

NOTE

If you are a configuration manager company identified in the table and you have implemented anything in the below or you find our information is incorrect, please let us know so we can get it fixed.

Configuration ManagersAnsibleChefPowerShell DSCPuppetSaltOtter
Manage Packagesxxxxxx
Install Chocolateyxxxxxx
Install Chocolatey from internal sourcexxxxx
Manage Sourcesxxxxxx
Manage Source Type (Admin/Self-Service)xx
Manage Featuresxxxx
Manage Config Settingsxxx

NOTE

Each x is linked to the specific feature documentation.

For most of these, those configuration managers have some sort of exec you could use to manage those additional aspects, but it would be best if they supported all aspects of configuration of Chocolatey as part of the provider implementations.

Ansible

Ansible has the win_chocolatey module that manages both packages and the installation of Chocolatey itself.

win_chocolatey:
  name: git
  source: https://my.internal.repository/api/v2/

Read More…

Boxstarter

Boxstarter is a lightweight configuration management utility.

Repeatable, reboot resilient Windows environment installations made easy using Chocolatey packages. When its time to repave either bare metal or virtualized instances, locally or on a remote machine, Boxstarter can automate both trivial and highly complex installations. Compatible with all Windows versions from Windows 7/2008 R2 forward.

Read more…

Chef

Chef 12.7+ has a built-in chocolatey_package resource to use with Chocolatey.

chocolatey_package 'git' do
  action :install
  source 'https://my.internal.repository/api/v2'
end

Resource - Read More…

When you need to also install Chocolatey, you would use the community cookbook to do so. The cookbook is maintained by the Chocolatey team. It has a package resource that can be used with older Chef versions.

include_recipe 'chocolatey'

Cookbook - Read More…

Example

Here’s a more in depth example from Nordstrom:

include_recipe 'chocolatey'

home = Dir.home
%W(
  #{home}/.chef
  #{home}/chef
  #{home}/chef/cookbooks
).each do |directory|
  directory directory
end

packages = node['chefdk_bootstrap']['package']

packages.each do |pkg, install|
  include_recipe "#{cookbook_name}::#{pkg}" if install
end

Another example from Facebook:

node.default['cpe_choco']['sources']['bacon'] =
  'source' => 'http://bacon.es.yummy',
}

Octopus Deploy

Octopus is a friendly deployment automation tool for .NET developers. It integrates with lots of utilities, and they have a template for installing Chocolatey packages: https://library.octopusdeploy.com/step-template/actiontemplate-chocolatey-install-package

Read more…

Otter

Otter has an open source Chocolatey extension that allows installing and uninstalling packages, specifying package versions, chocolatey sources, chocolatey features, and installing chocolatey itself.

Otter also keeps an inventory of Chocolatey packages installed on any or all servers.

Chocolatey::Ensure-Package
(
    Name: 7zip.install,
    Version: 18.5,
    Source: https://proget.local/chocolatey
);

Chocolatey::Ensure-Installed
(
    Version: latest,
    Source: https://proget.local/chocolatey
);

Chocolatey::Ensure-Source
(
    Name: Internal,
    Url: https://proget.local/chocolatey,
    Credential: DomainCred
);

Chocolatey::Ensure-Feature
(
    Feature: checksumFiles,
    Enabled: false
);

Read More…

PowerShell DSC

PowerShell DSC (Desired State Configuration) has a cChoco module that can manage both packages and the installation of Chocolatey itself.

  cChocoInstaller installChoco
  {
    InstallDir = "c:\ProgramData\chocolatey"
  }

  cChocoPackageInstaller installGit
  {
     Name = "git"
     DependsOn = "[cChocoInstaller]installChoco"
  }

Read More…

PowerShell PackageManagement

NOTE

Chocolatey has a prototype provider for the built-in package manager on Windows 10/Windows Server 2016 that was created by Microsoft awhile back. It is not fully functional and it may have security issues. If you want to use Chocolatey with PackageManagement, we recommend using ChocolateyGet, which is a nice bridge until an official one is implemented. No ETA has been defined.

PowerShell PackageManagement (aka OneGet) is a package manager aggregator that depends on the existence of package managers as providers to work, one of which is Chocolatey.

PSDeploy

PSDeploy is a quick and dirty module to simplify PowerShell based deployments.

Deploy SingleChocolateyPackage {
    By Chocolatey {
        FromSource 'c:\ChocolateyPackages\examplepackage.0.1.1.nupkg'
        To "http://your-choco-repo.internal.com/"
        WithOptions @{
            ApiKey = 'yourAPIkey'
            Force = $true
        }
    }
}

Read More…

Puppet

Puppet has a Supported module for Chocolatey puppetlabs/chocolatey. Note that there is also a chocolatey/chocolatey module, the supported module is a drop in replacement for the chocolatey/chocolatey module - please use puppetlabs/chocolatey as it has full configuration of Chocolatey.

include chocolatey

package { 'git':
  ensure   => latest,
  provider => 'chocolatey',
  source   => 'https://my.internal.repository/api/v2',
}

Puppet has some great documentation on getting started with Chocolatey. Be sure to check that out at Create, Install, and Repackage with Chocolatey.

The Chocolatey team is most familiar with Puppet and has written some documentation for using Puppet with Chocolatey. Please see

NOTE

If anyone would be interested in providing documentation similar to the above for other frameworks, we’d accept it as Pull Requests at https://github.com/chocolatey/docs.

Read More…

Saltstack

Salt has a Chocolatey module that manages both packages and the installation of Chocolatey itself.

salt '*' chocolatey.bootstrap
salt '*' chocolatey.install git

Read More…

System Center Configuration Manager

Chocolatey integrates with SCCM by handling the software management, and pointing to distribution points as the source for packages. This allows folks to get packages and larger binaries out to their network without constraints and still take advantage of Chocolatey’s fantastic abilities!

To direct Chocolatey package installs, you can still write GPOs to ensure this.

Microsoft Intune

Chocolatey’s Intune Integration is only available to our Chocolatey for Business customers. It allows you to take any Chocolatey package and convert them into an .intunewin format for pushing to your Intune tenant for hosting and distribution.

To get started with the Chocolatey Intune Integration please reference our setup and use documentation.