Forge Home

chocolatey

pdk
supported
Chocolatey package provider for Puppet

1,164,853 downloads

39,318 latest version

4.3 quality score

Version information

  • 6.0.1 (latest)
  • 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 Apr 19th 2021
This version is compatible with:
  • Puppet Enterprise 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 8.0.0
  • Windows

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-chocolatey', '6.0.1'
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 6.0.1

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 6.0.1 Apr 19th 2021

Reference

Table of Contents

Classes

Public Classes

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

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: $::chocolatey::params::install_location

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: $::chocolatey::params::use_7zip

seven_zip_download_url

Data type: String

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: $::chocolatey::params::seven_zip_download_url

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: $::chocolatey::params::install_timeout_seconds

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: $::chocolatey::params::download_url

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: $::chocolatey::params::enable_autouninstaller

log_output

Data type: Boolean

Log output from the installer. Defaults to false.

Default value: false

chocolatey_version

Data type: String

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

Default value: $::chocolatey::params::chocolatey_version

install_proxy

Data type: Any

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

Default value: undef

chocolatey::params

The chocolatey::params class.

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.