Forge Home

choco_app

Installs the Chocolatey package manager and configures sources

10,104 downloads

8,409 latest version

2.1 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.3.0 (latest)
  • 0.2.0
  • 0.1.0
released Oct 15th 2015
This version is compatible with:

Start using this module

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

Add this module to your Puppetfile:

mod 'gabe-choco_app', '0.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add gabe-choco_app
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install gabe-choco_app --version 0.3.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

gabe/choco_app — version 0.3.0 Oct 15th 2015

choco_app

OBSOLETE

Happily, this module is now obsolete! The chocolatey/chocolatey module is now able to install the Chocolatey application itself. Please switch over to using that module to install Chocolatey.

The only remaining useful functionality in this module is configuring the global list of sources for chocolatey. The easiest kludge around that is to set a resource default so that Package resources include an attribute for your local source.

Table of Contents

  1. Overview
  2. Module Description
  3. Setup - The Basics
  4. Usage - Configuration Options and Additional Functionality
  5. Reference - Class Parameters and Types
  6. Limitations - OS Compatibility, etc.
  7. Development - Guide for Contributing to the Module

Overview

This module will install and configure the Chocolatey package manager. It can also configure Chocolatey to include custom package sources.

Module Description

The main class uses the Powershell method from https://chocolatey.org/ to install the software. That places the binaries in the default location of C:\ProgramData\chocolatey\bin, and updates the system's command path to include that directory.

A defined type allows the addition of custom sources to the Chocolatey config.

Setup

To simply install Chocolatey with all configuration defaults, and only the main chocolatey.org source defined, just include the class. This results in the same set-up as if you'd gone to the chocolatey.org site and copied and pasted the powershell snippet from there into a command prompt on the target system.

include choco_app

Usage

To install Chocolatey and add extra sources to the list, simply include the main class, and use a choco_app::source resource to add the extra source. For instance:

include choco_app
choco_app::source { 'extras':
  url => 'http://artifactory.here.local:8081/artifactory/api/nuget/extras',
}

If you would like to omit the main chocolatey.org source entirely from your configuration -- perhaps local policy requires that you aim at an internal mirror instead -- you might declare the class and sources like this:

class { 'choco_app':
  include_chocolatey_org_src => false,
}
choco_app::source { 'mirror':
  url => 'http://artifactory.here.local:8081/artifactory/api/nuget/mirror',
}
choco_app::source { 'extras':
  url => 'http://artifactory.here.local:8081/artifactory/api/nuget/extras',
}

Multiple extra sources are allowed. See the Reference section below if you need to explicitly order the sources in the chocolatey.config file.

Reference

Classes

choco_app

Installs and configures Chocolatey.

contains_legacy_packages: The content of the "containsLegacyPackageInstalls" setting in the chocolatey.config file. Valid options: true or false. Default: 'true'

execution_timeout: The content of the "commandExecutionTimeoutSeconds" setting in the chocolatey.config file. Valid options: integer. Default: '2700'

checksum_files: The content of the "checksumFiles" setting in the chocolatey. config file. Valid options: true or false. Default: 'true'

autouninstaller: The content of the 'autoUninstaller" setting in the chocolatey.config file. Valid options: true or false. Default: 'false'

allow_global_confirmation: The content of the "allowGlobalConfirmation" setting in the chocolatey.config file. Valid options: true or false. Default: 'false'

include_chocolatey_org_src: Whether or not to include the main chocolatey.org source when building the chocolatey.config file. Useful if you're behind a firewall, or if local policy does not allow the use of sources on the Internet. Valid options: true or false. Default: 'true'

Types

choco_app::source

Inserts an additional source element in the chocolatey.config file to make Chocolatey search additional repositories for packages. See also the class parameter include_chocolatey_org_src if you wish to omit the main chocolatey.org repository itself from the config file.

source_id: The string to supply as the "id" for this source in the chocolatey. config. Valid options: string. Default value: the resource $name. (namevar)

url: The string to supply as the "value" for this source in the chocolatey. config. Valid options: string. Default value: none. (Required)

disabled: The string to supply for the "disabled" attribute of this source. Valid options: true or false. Default: 'false'

order: This parameter controls the relative order in which this source will be inserted in the chocolatey.config file. The main chocolatey.org source is set to an order of '30'. Valid options: 02 - 99. Default value: 50.

Limitations

Chocolatey is only available for Windows systems. Thus, this module is only relevant on Windows.

Development

This module has been designed to provide the bare minimum functionality to install and configure Chocolatey. The options that you can control in the chocolatey.config file are just the ones that a default installation has. There is nothing fancy here.

Fancy pull requests are heartily welcomed.

Release Notes

  • 0.1.0: Initial release.