No description
Find a file
Jeff McCune 86e86089fb Add note about semver.org leading v in tags.
James pointed out this was lacking in my release process document.  I've
added a note about the leading v in the annotated tag as per
http://semver.org/
2011-11-08 14:31:51 -08:00
lib (#10285) Refactor json to use pson instead. 2011-10-25 15:54:47 -07:00
manifests Move stages to after main 2011-05-26 10:21:42 -07:00
spec (Maint) Add watchr autotest script 2011-10-10 12:03:57 -07:00
tests (#8792) Rename basic smoke test to reflect file_line rename 2011-08-08 09:33:56 -07:00
.gitignore (#8797) Merge puppetlabs-functions into puppetlabs-stdlib 2011-08-05 10:31:46 +01:00
CHANGELOG * v2.x: 2011-11-08 14:16:11 -08:00
LICENSE (#8797) Merge puppetlabs-functions into puppetlabs-stdlib 2011-08-05 10:31:46 +01:00
Modulefile * v2.x: 2011-11-08 14:16:11 -08:00
Rakefile Copied function test scaffolding from puppet. 2011-06-29 12:25:43 +01:00
README.markdown Update CHANGELOG, README and Modulefile for v2.1.1 2011-08-18 10:52:54 -07:00
RELEASE_PROCESS.markdown Add note about semver.org leading v in tags. 2011-11-08 14:31:51 -08:00

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

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