Skip to content

Latest commit

 

History

History
472 lines (297 loc) · 12 KB

REFERENCE.md

File metadata and controls

472 lines (297 loc) · 12 KB

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