2011-05-24 20:06:30 +02: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
|
2011-05-24 20:23:16 +02:00
|
|
|
* Facts
|
2011-05-24 20:06:30 +02:00
|
|
|
* Functions
|
2011-05-24 20:23:16 +02:00
|
|
|
* Defined resource types
|
2011-05-24 20:06:30 +02:00
|
|
|
* 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.
|
|
|
|
|
2011-12-30 20:46:21 +01:00
|
|
|
# Versions #
|
|
|
|
|
|
|
|
This module follows semver.org (v1.0.0) versioning guidelines. The standard
|
|
|
|
library module is released as part of [Puppet
|
|
|
|
Enterprise](http://puppetlabs.com/puppet/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.
|
|
|
|
|
2011-05-24 20:23:16 +02:00
|
|
|
# Compatibility #
|
|
|
|
|
2011-12-30 20:46:21 +01:00
|
|
|
## 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.
|
2011-05-24 20:23:16 +02:00
|
|
|
|
2011-08-05 02:20:39 +02:00
|
|
|
# Functions #
|
2011-05-24 20:06:30 +02:00
|
|
|
|
2011-08-05 02:20:39 +02:00
|
|
|
Please see `puppet doc -r function` for documentation on each function. The
|
|
|
|
current list of functions is:
|
2011-05-24 20:06:30 +02:00
|
|
|
|
2011-08-05 02:20:39 +02:00
|
|
|
* getvar
|
|
|
|
* has\_key
|
|
|
|
* loadyaml
|
|
|
|
* merge.rb
|
|
|
|
* validate\_array
|
|
|
|
* validate\_bool
|
|
|
|
* validate\_hash
|
|
|
|
* validate\_re
|
|
|
|
* validate\_string
|
2011-05-24 20:06:30 +02:00
|
|
|
|
2011-06-22 02:06:46 +02:00
|
|
|
## validate\_hash ##
|
2011-05-24 20:23:16 +02:00
|
|
|
|
2011-06-22 02:06:46 +02:00
|
|
|
$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")
|
2011-08-18 01:37:20 +02:00
|
|
|
|
|
|
|
## Facts ##
|
|
|
|
|
2011-08-18 19:52:54 +02:00
|
|
|
Facts in `/etc/facter/facts.d` and `/etc/puppetlabs/facter/facts.d` are now loaded
|
2011-08-18 01:37:20 +02:00
|
|
|
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](https://github.com/ripienaar/facter-facts/tree/master/facts-dot-d)
|
|
|
|
|
2012-07-13 02:51:55 +02:00
|
|
|
stdlib releases beyond 2.x will not include external fact support using
|
|
|
|
facts-dot-d. Instead, these versions of stdlib require Facter 2.0 which
|
|
|
|
includes external fact support in the main Facter codebase.
|
|
|
|
|
|
|
|
Please see [2157](http://projects.puppetlabs.com/issues/2157) for more
|
|
|
|
information.
|
|
|
|
|