Puppet Class: chocolatey

Defined in:
manifests/init.pp

Summary

Used for managing installation and configuration of Chocolatey itself.

Overview

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:

  • choco_install_location (Stdlib::Windowspath) (defaults to: $facts['choco_install_path'])

    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:ProgramDatachocolatey’‘.

  • use_7zip (Boolean) (defaults to: false)

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

  • seven_zip_download_url (String) (defaults to: 'https://chocolatey.org/7za.exe')

    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 ‘chocolatey.org/7za.exe’.

  • choco_install_timeout_seconds (Integer) (defaults to: 1500)

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

  • chocolatey_download_url (Stdlib::Filesource) (defaults to: 'https://chocolatey.org/api/v2/package/chocolatey/')

    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 `’chocolatey.org/api/v2/package/chocolatey/‘`.

  • enable_autouninstaller (Boolean) (defaults to: true)
    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+.

  • log_output (Boolean) (defaults to: false)

    Log output from the installer. Defaults to ‘false`.

  • chocolatey_version (String) (defaults to: $facts['chocolateyversion'])
    • Informational parameter to tell

    Chocolatey what version to expect and to pre-load features with, falls back to ‘$::chocolateyversion`.

  • install_proxy (Any) (defaults to: undef)

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

Author:

  • Rob Reynolds, Rich Siegel, and puppet-chocolatey contributors



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'manifests/init.pp', line 76

class chocolatey (
  Stdlib::Windowspath $choco_install_location = $facts['choco_install_path'],
  Boolean $use_7zip                           = false,
  String $seven_zip_download_url              = 'https://chocolatey.org/7za.exe',
  Integer $choco_install_timeout_seconds      = 1500,
  Stdlib::Filesource $chocolatey_download_url = 'https://chocolatey.org/api/v2/package/chocolatey/',
  Boolean $enable_autouninstaller             = true,
  $log_output                                 = false,
  $chocolatey_version                         = $facts['chocolateyversion'],
  $install_proxy                              = undef,
) {
  class { '::chocolatey::install': }
  -> class { '::chocolatey::config': }

  contain '::chocolatey::install'
  contain '::chocolatey::config'
}