Forge Home

stdlib

Puppet Module Standard Library

119,889,706 downloads

42,204 latest version

3.8 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

  • 9.6.0 (latest)
  • 9.5.0
  • 9.4.1
  • 9.4.0
  • 9.3.0
  • 9.2.0
  • 9.1.0
  • 9.0.0
  • 8.6.0
  • 8.5.0
  • 8.4.0
  • 8.3.0
  • 8.2.0
  • 8.1.0
  • 8.0.0
  • 7.1.0
  • 7.0.1
  • 7.0.0
  • 6.6.0
  • 6.5.0
  • 6.4.0
  • 6.3.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.2.0
  • 5.1.0
  • 5.0.0
  • 4.25.1
  • 4.25.0
  • 4.24.0
  • 4.23.0
  • 4.22.0
  • 4.21.0
  • 4.20.0
  • 4.19.0
  • 4.18.0
  • 4.17.1
  • 4.17.0
  • 4.16.0
  • 4.15.0
  • 4.14.0
  • 4.13.1
  • 4.13.0
  • 4.12.0
  • 4.11.0
  • 4.10.0
  • 4.9.1
  • 4.9.0
  • 4.8.0
  • 4.7.0
  • 4.6.0
  • 4.5.1
  • 4.5.0
  • 4.4.0
  • 4.3.2
  • 4.3.0
  • 4.2.2
  • 4.2.1
  • 4.2.0
  • 4.1.0
  • 3.2.2
  • 3.2.1
  • 3.2.0
  • 3.1.1
  • 3.1.0
  • 3.0.1
  • 3.0.0
  • 2.6.0
  • 2.5.1
  • 2.5.0
  • 2.4.0
  • 2.3.3
  • 2.3.2
  • 2.3.1
  • 2.3.0
  • 2.2.1
  • 2.2.0
  • 2.1.3
  • 2.0.0
  • 1.1.0
  • 1.0.0
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
released May 11th 2012

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-stdlib', '2.3.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-stdlib --version 2.3.2

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/stdlib — version 2.3.2 May 11th 2012

Puppet Labs Standard Library

This module provides a "standard library" of resources for developing Puppet Modules. This modules will include the following additions to Puppet

  • Stages
  • Facts
  • Functions
  • Defined resource types
  • Types
  • Providers

This module is officially curated and provided by Puppet Labs. The modules Puppet Labs writes and distributes will make heavy use of this standard library.

Versions

This module follows semver.org (v1.0.0) versioning guidelines. The standard library module is released as part of Puppet Enterprise and as a result older versions of Puppet Enterprise that Puppet Labs still supports will have bugfix maintenance branches periodically "merged up" into master. The current list of integration branches are:

  • v2.1.x (v2.1.1 released in PE 1.2, 1.2.1, 1.2.3, 1.2.4)
  • v2.2.x (Never released as part of PE, only to the Forge)
  • v2.3.x (Scheduled for next PE feature release)
  • master (mainline development branch)

The first Puppet Enterprise version including the stdlib module is Puppet Enterprise 1.2.

Compatibility

stdlib v2.1.x, v2.2.x

v2.1.x and v2.2.x of this module are designed to work with Puppet versions 2.6.x and 2.7.x. There are currently no plans for a Puppet 0.25 standard library module.

stdlib v2.3.x

While not yet released, the standard library may only work with Puppet 2.7.x.

Functions

Please see puppet doc -r function for documentation on each function. The current list of functions is:

  • getvar
  • has_key
  • loadyaml
  • merge.rb
  • validate_array
  • validate_bool
  • validate_hash
  • validate_re
  • validate_string

validate_hash

$somehash = { 'one' => 'two' }
validate\_hash($somehash)

getvar()

This function aims to look up variables in user-defined namespaces within puppet. Note, if the namespace is a class, it should already be evaluated before the function is used.

$namespace = 'site::data'
include "${namespace}"
$myvar = getvar("${namespace}::myvar")

Facts

Facts in /etc/facter/facts.d and /etc/puppetlabs/facter/facts.d are now loaded automatically. This is a direct copy of R.I. Pienaar's custom facter fact located at: https://github.com/ripienaar/facter-facts/tree/master/facts-dot-d