Version information
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-stdlib', '2.2.1'
Learn more about managing modules with a PuppetfileDocumentation
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
Types in this module release
2011-12-30 Puppet Labs support@puppetlabs.com - 2.2.1
- Documentation only release for the Forge
2011-12-30 Puppet Labs support@puppetlabs.com - 2.1.2
- Documentation only release for PE 2.0.x
2011-11-08 Puppet Labs support@puppetlabs.com - 2.2.0
- #10285 - Refactor json to use pson instead.
- Maint - Add watchr autotest script
- Maint - Make rspec tests work with Puppet 2.6.4
- #9859 - Add root_home fact and tests
2011-08-18 Puppet Labs support@puppetlabs.com - 2.1.1
- Change facts.d paths to match Facter 2.0 paths.
- /etc/facter/facts.d
- /etc/puppetlabs/facter/facts.d
2011-08-17 Puppet Labs support@puppetlabs.com - 2.1.0
- Add R.I. Pienaar's facts.d custom facter fact
- facts defined in /etc/facts.d and /etc/puppetlabs/facts.d are automatically loaded now.
2011-08-04 Puppet Labs support@puppetlabs.com - 2.0.0
- Rename whole_line to file_line
- This is an API change and as such motivating a 2.0.0 release according to semver.org.
2011-08-04 Puppet Labs support@puppetlabs.com - 1.1.0
- Rename append_line to whole_line
- This is an API change and as such motivating a 1.1.0 release.
2011-08-04 Puppet Labs support@puppetlabs.com - 1.0.0
- Initial stable release
- Add validate_array and validate_string functions
- Make merge() function work with Ruby 1.8.5
- Add hash merging function
- Add has_key function
- Add loadyaml() function
- Add append_line native
2011-06-21 Jeff McCune jeff@puppetlabs.com - 0.1.7
- Add validate_hash() and getvar() functions
2011-06-15 Jeff McCune jeff@puppetlabs.com - 0.1.6
- Add anchor resource type to provide containment for composite classes
2011-06-03 Jeff McCune jeff@puppetlabs.com - 0.1.5
- Add validate_bool() function to stdlib
0.1.4 2011-05-26 Jeff McCune jeff@puppetlabs.com
- Move most stages after main
0.1.3 2011-05-25 Jeff McCune jeff@puppetlabs.com
- Add validate_re() function
0.1.2 2011-05-24 Jeff McCune jeff@puppetlabs.com
- Update to add annotated tag
0.1.1 2011-05-24 Jeff McCune jeff@puppetlabs.com
- Add stdlib::stages class with a standard set of stages
Copyright (C) 2011 Puppet Labs Inc and some parts: Copyright (C) 2011 Krzysztof Wilczynski Puppet Labs can be contacted at: info@puppetlabs.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.