Forge Home

stdlib

Puppet Module Standard Library

119,889,671 downloads

42,197 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 Aug 5th 2011

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-stdlib', '1.0.0'
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 1.0.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

puppetlabs/stdlib — version 1.0.0 Aug 5th 2011

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.

Compatibility

This module is designed to work with Puppet version 2.6 and later. It may be forked if Puppet 2.7 specific features are added. There are currently no plans for a Puppet 0.25 standard library module.

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")