One advantage of Linux distributions is they include software package managers like
yum
or apt-get
. Package managers make is easy to install software with a single command, like yum install vlc
. There is a package manager for Windows that works well and integrates with Puppet: Chocolatey. Let’s explore how to use Chocolatey and how it works with Puppet.Microsoft has a package manager,
OneGet
, but OneGet
new enough that it’s not installed by default in PeopleSoft-certified versions of Windows.Install Chocolatey via PowerShell
If you want to install Chocolatey with PowerShell, the Chocolatey installation page has example commands to do this. The scripts will download and execute a remotely signed PowerShell script which installs Chocolatey and configures it for you. I used:
to install Chocolatey on my server.
Using Chocolatey
After installation, restart your PowerShell window. Installing software with Chocolatey is a simple as running this command:
Chocolatey will install Notepad++ for you. Simple!
Want to install
git
on your server?Done.
If you want to accept license agreements automatically, run this command to change Chocolatey’s global setting:
I primarily use Chocolatey for server management, but you can use it to manager your workstation too. The library of chocolatey packages contains server and workstation software. To view the library, head over to the chocolatey website.
Install Chocolatey via Puppet
chocolatey can be used with Puppet to manage software package on your server. There is an official Puppet module for Chocolatey, so we can install the module and use it our own manifests.
You may fine the the module install failed due because the Puppet Forge root certificate is not in the Windows keystore. You’ll also notice some warnings about the version number for the
pt_xxx
modules. You can ignore those warnings; the version numbers used by the PeopleTools team don’t follow the Puppet conventions.To install the root certificate for Puppet Forge:
Lucky Me • 8. Jay z song list. Friend or Foe '98 • 7. Sunshine, (Always Be My) - (featuring Babyface / Foxy Brown) • 9.
- Save this certificate (GeoTrust Global CA) as
GeoTrustCA.pem
. - Run
certutil -v -addstore Root .GeoTrustCa.pem
to add the certificate - Re-run
puppet module install chocolatey-chocolatey
The Chocolatey module depends on three additional Puppet libraries, so the installation windows shows you the dependencies it installed.
Use Chocolatey with Puppet
Now we can use Chocolatey in Puppet manfiests. This is great because we can standardize software packages on our servers the same way we standardize configurations.
On my Windows Servers, I use Process Explorer to troubleshoot issues. It’s a free tool from Microsoft and is great for finding processes that are locking access to files. Let’s write a Puppet manifest to install Process Explorer using chocolatey.
On the Chocolatey Packages page, search for “Process Explorer”.
In the results, you’ll see the Chocolatey command to install Process Explorer. Copy the name of the package; we’ll use the name in our manifest.
![How To Use Chocolatey Windows How To Use Chocolatey Windows](/uploads/1/2/3/7/123753892/419207095.png)
Create
windows_software.pp
under puppetetcmanifests
. The first line of the manifest will be to include the “Chocolatey” library.Then, we need to define a Puppet resource. We use the
package
resource, give it the name of the Chocolatey package (from above), and set the ensure
parameter.Finally, we tell Puppet to use Chocolatey as the package manager.
![How To Use Chocolatey Windows How To Use Chocolatey Windows](/uploads/1/2/3/7/123753892/607810037.jpg)
Save
windows_software.pp
and run puppet apply
:![How To Use Chocolatey Windows How To Use Chocolatey Windows](/uploads/1/2/3/7/123753892/339042022.png)
When the Puppet run is done, you’ll find Process Explorer installed into Chocolatey’s installation directory. The default directory is
C:ProgramDatachocolateylib
.Update: 9/27/2016
Andy from the psadmin.io Community and podcast episode 42 suggested this tip for using Chocolatey to install git:
This will install additional tools like SSH with Git. Thanks Andy!
03 Jan 2016 #WindowsI’ve recently started taking a look at Chocolatey –“apt-get for Windows” – and here are a couple of how-to’s…
Install Chocolatey on Windows 10 64-bit
First off, you might want to know why I’m not using the built-in OneGet,which is a “package manager manager” [sic]?
Well, it turns out there’s no good way of upgrading an installed packageusing e.g. Chocolatey via OneGet. Duh. Keep an eye on this github issue:https://github.com/OneGet/oneget/issues/6
Well, it turns out there’s no good way of upgrading an installed packageusing e.g. Chocolatey via OneGet. Duh. Keep an eye on this github issue:https://github.com/OneGet/oneget/issues/6
The most up to date instructions should be available over at https://chocolatey.org and I installed via anelevated command prompt (
cmd.exe
).Install Python
Check for latest version available via Chocolatey:
Check for specific version:
Chocolatey Install Windows 10
Install specific version and into custom location using install arguments:
List all Chocolatey-installed packages:
Update to latest version:
…or upgrade to specific version: