Back to Top

Installing Chocolatey Packages using Otter

Otter is an Infrastructure Automation tool that utilizes Infrastructure as Code to help teams and enterprises with server management and orchestration automation. For this tutorial, we will demonstrate how to Install Chocolatey packages

Chocolatey hosts thousands of packages, and is a popular choice to help manage and install Windows software. In this tutorial we’ll demonstrate how to ensure the correct version of a Chocolatey package is installed on a remote server using Otter.

Step 1: Create Server

Install the Inedo Agent and Chocolatey on a server, and then enter the servers details into Otter.

Step 2: Create/Edit Plan

Create a Plan. For this tutorial we’ll create the plan at the server level, but it could be done at the Role level as well.

Installing a Chocolaty package just requires one Operation Ensure Chocolatey. Because this is an ensure operation Otter will first check to see if the Chocolatey package is there, and is the right version, and only install the package if needed.

For this example we’ll install version 1.0.0 of upack.

After saving the operation the status of the server will become Drifted. This is expected because the sever now has configuration different than what is specified for it, (having the upack package installed).

This is easily fixed by clicking Remediate with Job and running a configuration job, which will run the ensure operation and install the correct Chocolatey package on the server.

Step 3: Ensure Latest

This installed version 1.0.0 of the upack package, but if you always want to have the latest version of a package available simply edit the ensure chocolatey package operation and leave the version field blank

This will again put configuration in drift status that can be remedied in the same manner as before.

After remediation it is a simple matter to check that version 1.0.1 (the latest version of upack) is installed. By clicking the ‘View Configuration’ button for the server we’re working with.