summaryrefslogtreecommitdiffstats
path: root/documentation/reference/functions.page
blob: ad2c03f5a8abb349aa1afd1e5821ac35b1fe4458 (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
---
inMenu: true
title: Function Reference
orderInfo: 40 
---
        
There are two types of functions in Puppet: Statements and rvalues.
Statements stand on their own and do not return arguments; they are used for
performing stand-alone work like importing.  Rvalues return values and can
only be used in a statement requiring a value, such as an assignment or a case
statement. 

Here are the functions available in Puppet:
                        

* **alert** (*statement*):  Log a message on the server at level alert.

* **crit** (*statement*):  Log a message on the server at level crit.

* **debug** (*statement*):  Log a message on the server at level debug.

* **defined** (*rvalue*):  Determine whether a given type is defined, either as a native type or a defined type, or whether a resource has been specified.  If you are checking with a resource is defined, use the normal resource reference syntax, e.g., ``File['/etc/passwd']``.

* **emerg** (*statement*):  Log a message on the server at level emerg.

* **err** (*statement*):  Log a message on the server at level err.

* **fail** (*statement*):  Fail with a parse error.

* **include** (*statement*):  Evaluate one or more classes.

* **info** (*statement*):  Log a message on the server at level info.

* **notice** (*statement*):  Log a message on the server at level notice.

* **realize** (*statement*):  Make a virtual object real.  This is useful when you want to know the name of the virtual object and don't want to bother with a full collection.  It is slightly faster than a collection, and, of course, is a bit shorter.  You must pass the object using a reference; e.g.: ``realize User[luke]``.

* **tag** (*statement*):  Add the specified tags to the containing class or definition.  All contained objects will then acquire that tag, also. 

* **tagged** (*rvalue*):  A boolean function that tells you whether the current container is tagged with the specified tags. The tags are ANDed, so thta all of the specified tags must be included for the function to return true.

* **template** (*rvalue*):  Evaluate a template and return its value.  See [the templating docs](/trac/puppet/wiki/PuppetTemplating) for more information.  Note that if multiple templates are specified, their output is all concatenated and returned as the output of the function.

* **warning** (*statement*):  Log a message on the server at level warning.



----------------


*This page autogenerated on Fri Jan 26 16:40:49 CST 2007*