Forge Home

chocolatey

Chocolatey package provider for Puppet

1,411,705 downloads

20,270 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 8.0.0 (latest)
  • 7.0.1
  • 7.0.0
  • 6.2.1
  • 6.2.0
  • 6.1.1
  • 6.1.0
  • 6.0.1
  • 6.0.0
  • 5.2.1
  • 5.2.0
  • 5.1.1
  • 5.1.0
  • 5.0.2
  • 5.0.1
  • 5.0.0
  • 4.1.0
  • 4.0.0
  • 3.3.0
  • 3.2.0
  • 3.1.1
  • 3.1.0
  • 3.0.0
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 0.8.0
  • 0.7.0
released May 31st 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
Tasks:
  • chocolatey
  • outdated
  • pin
  • status

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-chocolatey', '8.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-chocolatey
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-chocolatey --version 8.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/chocolatey — version 8.0.0 May 31st 2023

Reference

Table of Contents

Classes

Public Classes

  • chocolatey: Used for managing installation and configuration of Chocolatey itself.

Private Classes

  • chocolatey::config: Handles configuration of Chocolatey
  • chocolatey::install: Handles installation of Chocolatey

Resource types

  • chocolateyconfig: Allows managing config settings for Chocolatey. Configuration values provide settings for users to configure aspects of Chocolatey and the wa
  • chocolateyfeature: Allows managing features for Chocolatey. Features are configuration that act as feature flippers to turn on or off certain aspects of how Cho
  • chocolateysource: Allows managing sources for Chocolatey. A source can be a folder, a CIFS share, a NuGet Http OData feed, or a full Package Gallery. Learn mor

Tasks

  • init: Manage a package
  • outdated: List outdated packages
  • pin: Manage package pinning
  • status: List currently installed packages

Classes

chocolatey

Used for managing installation and configuration of Chocolatey itself.

Examples

Default - This will by default ensure Chocolatey is installed and ready for use.
include chocolatey
Override default install location
class {'chocolatey':
  choco_install_location => 'D:\secured\choco',
}
Use an internal Chocolatey.nupkg for installation
class {'chocolatey':
  chocolatey_download_url         => 'https://internalurl/to/chocolatey.nupkg',
  use_7zip                        => false,
  choco_install_timeout_seconds   => 2700,
}
Use a file chocolatey.0.9.9.9.nupkg for installation
class {'chocolatey':
  chocolatey_download_url         => 'file:///c:/location/of/chocolatey.0.9.9.9.nupkg',
  use_7zip                        => false,
  choco_install_timeout_seconds   => 2700,
}
Log chocolatey bootstrap installer script output
class {'chocolatey':
  log_output              => true,
}
Disable autouninstaller (use when less than 0.9.9.8)
class {'chocolatey':
  enable_autouninstaller => false,
}

Parameters

The following parameters are available in the chocolatey class:

choco_install_location

Data type: Stdlib::Windowspath

Where Chocolatey install should be located. This needs to be an absolute path starting with a drive letter e.g. c:\. Defaults to the currently detected install location based on the ChocolateyInstall environment variable, falls back to 'C:\ProgramData\chocolatey'.

Default value: $facts['choco_install_path']

use_7zip

Data type: Boolean

Whether to use built-in shell or allow installer to download 7zip to extract chocolatey.nupkg during installation. Defaults to false.

Default value: false

seven_zip_download_url

Data type: String[1]

Specifies the source file for 7za.exe. Supports all sources supported by Puppet's file resource. You should use a 32bit binary for compatibility. Defaults to 'https://chocolatey.org/7za.exe'.

Default value: 'https://chocolatey.org/7za.exe'

choco_install_timeout_seconds

Data type: Integer

How long in seconds should be allowed for the install of Chocolatey (including .NET Framework 4 if necessary). Defaults to 1500 (25 minutes).

Default value: 1500

chocolatey_download_url

Data type: Stdlib::Filesource

A url that will return chocolatey.nupkg. This must be a url, but not necessarily an OData feed. Any old url location will work. Defaults to 'https://chocolatey.org/api/v2/package/chocolatey/'.

Default value: 'https://chocolatey.org/api/v2/package/chocolatey/'

enable_autouninstaller

Data type: Boolean

[Deprecated] - Should auto uninstaller be turned on? Auto uninstaller is what allows Chocolatey to automatically manage the uninstall of software from Programs and Features without necessarily requiring a chocolateyUninstall.ps1 file in the package. Defaults to true. Setting is ignored in Chocolatey v0.9.10+.

Default value: true

log_output

Data type: Boolean

Log output from the installer. Defaults to false.

Default value: false

chocolatey_version

Data type: String[1]

  • Informational parameter to tell Chocolatey what version to expect and to pre-load features with, falls back to $::chocolateyversion.

Default value: $facts['chocolateyversion']

install_proxy

Data type: Optional[String[1]]

Proxy server to use to use for installation of chocolatey itself or undef to not use a proxy

Default value: undef

Resource types

chocolateyconfig

Allows managing config settings for Chocolatey. Configuration values provide settings for users to configure aspects of Chocolatey and the way it functions. Similar to features, except allow for user configured values. Requires 0.9.10+. Learn more about config at https://chocolatey.org/docs/commands-config

Properties

The following properties are available in the chocolateyconfig type.

ensure

Valid values: present, absent

Specifies state of resource

Default value: present

value

The value of the config setting. If the name includes 'password', then the value is not ensurable due to being encrypted in the configuration file.

Parameters

The following parameters are available in the chocolateyconfig type.

name

namevar

The name of the config setting. Used for uniqueness. Puppet is not able to easily manage any values that include Password in the key name in them as they will be encrypted in the configuration file.

provider

The specific backend to use for this chocolateyconfig resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

chocolateyfeature

Allows managing features for Chocolatey. Features are configuration that act as feature flippers to turn on or off certain aspects of how Chocolatey works. Learn more about features at https://chocolatey.org/docs/commands-feature

Properties

The following properties are available in the chocolateyfeature type.

ensure

Valid values: enabled, disabled

Specifies state of resource

Parameters

The following parameters are available in the chocolateyfeature type.

name

namevar

The name of the feature. Used for uniqueness.

provider

The specific backend to use for this chocolateyfeature resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

chocolateysource

Allows managing sources for Chocolatey. A source can be a folder, a CIFS share, a NuGet Http OData feed, or a full Package Gallery. Learn more about sources at https://chocolatey.org/docs/how-to-host-feed

Properties

The following properties are available in the chocolateysource type.

admin_only

Valid values: true, false

Option to specify whether this source should visible to Windows user accounts in the Administrators group only.

Requires Chocolatey for Business (C4B) v1.12.2+ and at least Chocolatey v0.10.8 for the setting to be respected. Defaults to false.

Default value: false

allow_self_service

Valid values: true, false

Option to specify whether this source should be allowed to be used with Chocolatey Self Service.

Requires Chocolatey for Business (C4B) v1.10.0+ with the feature useBackgroundServiceWithSelfServiceSourcesOnly turned on in order to be respected. Also requires at least Chocolatey v0.10.4 for the setting to be enabled. Defaults to false.

Default value: false

bypass_proxy

Valid values: true, false

Option to specify whether this source should explicitly bypass any explicitly or system configured proxies. Requires at least Chocolatey v0.10.4. Defaults to false.

Default value: false

ensure

Valid values: present, disabled, absent

Specifies state of resource

Default value: present

location

The location of the source repository. Can be a url pointing to an OData feed (like chocolatey/chocolatey_server), a CIFS (UNC) share, or a local folder. Required when ensure => present (the default for ensure).

priority

Optional priority for explicit feed order when searching for packages across multiple feeds. The lower the number the higher the priority. Sources with a 0 priority are considered no priority and are added after other sources with a priority number. Requires at least Chocolatey v0.9.9.9. Defaults to 0.

Default value: 0

user

Optional user name for authenticated feeds. Requires at least Chocolatey v0.9.9.0. Defaults to nil. Specifying an empty value is the same as setting the value to nil or not specifying the property at all.

Default value: ''

Parameters

The following parameters are available in the chocolateysource type.

name

namevar

The name of the source. Used for uniqueness.

password

Optional user password for authenticated feeds. Not ensurable. Value is not able to be checked with current value. If you need to update the password, update another setting as well. Requires at least Chocolatey v0.9.9.0. Defaults to nil. Specifying an empty value is the same as setting the value to nil or not specifying the property at all.

Default value: ''

provider

The specific backend to use for this chocolateysource resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

Tasks

init

Manage a package

Supports noop? false

Parameters

action

Data type: Enum[install,upgrade,uninstall]

Action to perform

package

Data type: String[1]

Package to manipulate

version

Data type: Optional[String[1]]

Use a specific version

outdated

List outdated packages

Supports noop? false

pin

Manage package pinning

Supports noop? false

Parameters

action

Data type: Enum[list,add,remove]

Action to perform

package

Data type: Optional[String[1]]

Package to manipulate

version

Data type: Optional[String[1]]

Use a specific version

status

List currently installed packages

Supports noop? false