summaryrefslogtreecommitdiff
path: root/README.markdown
blob: 4f0665179b5aaf931c8d25f863217d3153b75bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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](https://github.com/ripienaar/facter-facts/tree/master/facts-dot-d)