puppetlabs/stdlib/2.2.0 |
|
|
Author: Puppet Labs
Tags:
|
|
How to Install
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
2011-11-08 Puppet Labs - 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 - 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 - 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 - 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 - 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 - 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 - 0.1.7
* Add validate_hash() and getvar() functions
2011-06-15 Jeff McCune - 0.1.6
* Add anchor resource type to provide containment for composite classes
2011-06-03 Jeff McCune - 0.1.5
* Add validate_bool() function to stdlib
0.1.4 2011-05-26 Jeff McCune
* Move most stages after main
0.1.3 2011-05-25 Jeff McCune
* Add validate_re() function
0.1.2 2011-05-24 Jeff McCune
* Update to add annotated tag
0.1.1 2011-05-24 Jeff McCune
* 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.
-
anchor
-
Description
A simple resource type intended to be used as an anchor in a composite class.
class ntp { class { 'ntp::package': } -> class { 'ntp::config': } -> class { 'ntp::service': } # These two resources "anchor" the composed classes # such that the end user may use "require" and "before" # relationships with Class['ntp'] anchor { 'ntp::begin': } -> class { 'ntp::package': } class { 'ntp::service': } -> anchor { 'ntp::end': } }This resource allows all of the classes in the ntp module to be contained within the ntp class from a dependency management point of view.
This allows the end user of the ntp module to establish require and before relationships easily:
class { 'ntp': } -> class { 'mcollective': } class { 'mcollective': } -> class { 'ntp': } -
Parameters
- name
The name of the anchor resource.
-
Providers
-
-
file_line
-
Description
Type that can append whole a line to a file if it does not already contain it.
Example:
file_line { ‘sudo_rule’: path => ‘/etc/sudoers’, line => ‘%admin ALL=(ALL) ALL’, }
-
Parameters
- name
arbitrary name used as identity
- line
The line to be appended to the path.
- path
File to possibly append a line to.
-
Properties
- ensure
Valid values are
present.
-
Providers
- ruby
-
