d30e7f81d0
Based on feedback from Luke, the facts.d directory should at least match the directory that will be used by Facter 2.0. Reading #2157 I believe the Facter 2.0 facts.d feature is reasonably API compatible with this custom fact from R.I. so I'm comfortable using the same filesystem path. Change in behavior: Now look for facts in: * /etc/facter/facts.d * /etc/puppetlabs/facter/facts.d |
||
---|---|---|
lib | ||
manifests | ||
spec | ||
tests | ||
.gitignore | ||
CHANGELOG | ||
LICENSE | ||
Modulefile | ||
README.markdown | ||
RELEASE_PROCESS.markdown |
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/facts.d
and /etc/puppetlabs/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