Mercurial > repos > other > Puppet
annotate modules/stdlib/README.markdown @ 220:ccc13f56f8ec puppet-3.6
Blacklist lots more users from SSH probes
Includes the german for "web page"
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Sep 2019 10:34:43 +0100 |
parents | addb0ea390a1 |
children |
rev | line source |
---|---|
37 | 1 #stdlib |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 [![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-stdlib.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-stdlib) |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
37 | 5 ####Table of Contents |
6 | |
7 1. [Overview](#overview) | |
8 2. [Module Description - What the module does and why it is useful](#module-description) | |
9 3. [Setup - The basics of getting started with stdlib](#setup) | |
10 4. [Usage - Configuration options and additional functionality](#usage) | |
11 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) | |
12 5. [Limitations - OS compatibility, etc.](#limitations) | |
13 6. [Development - Guide for contributing to the module](#development) | |
14 | |
15 ##Overview | |
16 | |
17 Adds a standard library of resources for Puppet modules. | |
18 | |
19 ##Module Description | |
20 | |
21 This module provides a standard library of resources for the development of Puppet | |
22 modules. Puppet modules make heavy use of this standard library. The stdlib module adds the following resources to Puppet: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 * Stages |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 * Facts |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 * Functions |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 * Defined resource types |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 * Types |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 * Providers |
37 | 30 |
31 > *Note:* As of version 3.7, Puppet Enterprise no longer includes the stdlib module. If you're running Puppet Enterprise, you should install the most recent release of stdlib for compatibility with Puppet modules. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 |
37 | 33 ##Setup |
34 | |
35 Installing the stdlib module adds the functions, facts, and resources of this standard library to Puppet. | |
36 | |
37 ##Usage | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 |
37 | 39 After you've installed stdlib, all of its functions, facts, and resources are available for module use or development. |
40 | |
41 If you want to use a standardized set of run stages for Puppet, `include stdlib` in your manifest. | |
42 | |
43 ## Reference | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
44 |
37 | 45 ### Classes |
46 | |
47 #### Public Classes | |
48 | |
49 * `stdlib`: Most of stdlib's features are automatically loaded by Puppet. To use standardized run stages in Puppet, declare this class in your manifest with `include stdlib`. | |
50 | |
51 When declared, stdlib declares all other classes in the module. The only other class currently included in the module is `stdlib::stages`. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 |
37 | 53 The stdlib class has no parameters. |
54 | |
55 #### Private Classes | |
56 | |
57 * `stdlib::stages`: This class manages a standard set of run stages for Puppet. It is managed by the stdlib class and should not be declared independently. | |
58 | |
59 The `stdlib::stages` class declares various run stages for deploying infrastructure, language runtimes, and application layers. The high level stages are (in order): | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
60 |
37 | 61 * setup |
62 * main | |
63 * runtime | |
64 * setup_infra | |
65 * deploy_infra | |
66 * setup_app | |
67 * deploy_app | |
68 * deploy | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
69 |
37 | 70 Sample usage: |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
71 |
37 | 72 ``` |
73 node default { | |
74 include stdlib | |
75 class { java: stage => 'runtime' } | |
76 } | |
77 ``` | |
78 | |
79 ### Resources | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 |
37 | 81 * `file_line`: This resource ensures that a given line, including whitespace at the beginning and end, is contained within a file. If the line is not contained in the given file, Puppet will add the line. Multiple resources can be declared to manage multiple lines in the same file. You can also use match to replace existing lines. |
82 | |
83 ``` | |
84 file_line { 'sudo_rule': | |
85 path => '/etc/sudoers', | |
86 line => '%sudo ALL=(ALL) ALL', | |
87 } | |
88 file_line { 'sudo_rule_nopw': | |
89 path => '/etc/sudoers', | |
90 line => '%sudonopw ALL=(ALL) NOPASSWD: ALL', | |
91 } | |
92 ``` | |
93 | |
94 * `after`: Specify the line after which Puppet will add any new lines. (Existing lines are added in place.) Optional. | |
95 * `ensure`: Ensures whether the resource is present. Valid values are 'present', 'absent'. | |
96 * `line`: The line to be added to the file located by the `path` parameter. | |
97 * `match`: A regular expression to run against existing lines in the file; if a match is found, we replace that line rather than adding a new line. Optional. | |
98 * `multiple`: Determine if match can change multiple lines. Valid values are 'true', 'false'. Optional. | |
99 * `name`: An arbitrary name used as the identity of the resource. | |
100 * `path`: The file in which Puppet will ensure the line specified by the line parameter. | |
101 | |
102 ### Functions | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
103 |
37 | 104 * `abs`: Returns the absolute value of a number; for example, '-34.56' becomes '34.56'. Takes a single integer and float value as an argument. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
105 |
37 | 106 * `any2array`: This converts any object to an array containing that object. Empty argument lists are converted to an empty array. Arrays are left untouched. Hashes are converted to arrays of alternating keys and values. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
107 |
37 | 108 * `base64`: Converts a string to and from base64 encoding. |
109 Requires an action ('encode', 'decode') and either a plain or base64-encoded | |
110 string. *Type*: rvalue | |
111 | |
112 * `bool2num`: Converts a boolean to a number. Converts values: | |
113 * 'false', 'f', '0', 'n', and 'no' to 0. | |
114 * 'true', 't', '1', 'y', and 'yes' to 1. | |
115 Requires a single boolean or string as an input. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 |
37 | 117 * `capitalize`: Capitalizes the first letter of a string or array of strings. |
118 Requires either a single string or an array as an input. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 |
37 | 120 * `chomp`: Removes the record separator from the end of a string or an array of |
121 strings; for example, 'hello\n' becomes 'hello'. Requires a single string or array as an input. *Type*: rvalue | |
122 | |
123 * `chop`: Returns a new string with the last character removed. If the string ends with '\r\n', both characters are removed. Applying `chop` to an empty string returns an empty string. If you want to merely remove record separators, then you should use the `chomp` function. Requires a string or an array of strings as input. *Type*: rvalue | |
124 | |
125 * `concat`: Appends the contents of array 2 onto array 1. For example, `concat(['1','2','3'],'4')` results in: ['1','2','3','4']. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
126 |
37 | 127 * `count`: Takes an array as first argument and an optional second argument. Count the number of elements in array that matches second argument. If called with only an array, it counts the number of elements that are **not** nil/undef. *Type*: rvalue |
128 | |
129 * `defined_with_params`: Takes a resource reference and an optional hash of attributes. Returns 'true' if a resource with the specified attributes has already been added to the catalog. Returns 'false' otherwise. | |
130 | |
131 ``` | |
132 user { 'dan': | |
133 ensure => present, | |
134 } | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
135 |
37 | 136 if ! defined_with_params(User[dan], {'ensure' => 'present' }) { |
137 user { 'dan': ensure => present, } | |
138 } | |
139 ``` | |
140 | |
141 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
142 |
37 | 143 * `delete`: Deletes all instances of a given element from an array, substring from a |
144 string, or key from a hash. For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
145 |
37 | 146 * `delete_at`: Deletes a determined indexed value from an array. For example, `delete_at(['a','b','c'], 1)` returns ['a','c']. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
147 |
37 | 148 * `delete_values`: Deletes all instances of a given value from a hash. For example, `delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')` returns {'a'=>'A','c'=>'C','B'=>'D'} *Type*: rvalue |
149 | |
150 * `delete_undef_values`: Deletes all instances of the undef value from an array or hash. For example, `$hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})` returns {a => 'A', b => '', d => false}. *Type*: rvalue | |
151 | |
152 * `difference`: Returns the difference between two arrays. | |
153 The returned array is a copy of the original array, removing any items that | |
154 also appear in the second array. For example, `difference(["a","b","c"],["b","c","d"])` returns ["a"]. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
155 |
37 | 156 * `dirname`: Returns the `dirname` of a path. For example, `dirname('/path/to/a/file.ext')` returns '/path/to/a'. |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
157 |
37 | 158 * `downcase`: Converts the case of a string or of all strings in an array to lowercase. *Type*: rvalue |
159 | |
160 * `empty`: Returns 'true' if the variable is empty. *Type*: rvalue | |
161 | |
162 * `ensure_packages`: Takes a list of packages and only installs them if they don't already exist. It optionally takes a hash as a second parameter to be passed as the third argument to the `ensure_resource()` function. *Type*: statement | |
163 | |
164 * `ensure_resource`: Takes a resource type, title, and a list of attributes that describe a resource. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
165 |
37 | 166 ``` |
167 user { 'dan': | |
168 ensure => present, | |
169 } | |
170 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
171 |
37 | 172 This example only creates the resource if it does not already exist: |
173 | |
174 `ensure_resource('user', 'dan', {'ensure' => 'present' })` | |
175 | |
176 If the resource already exists, but does not match the specified parameters, this function attempts to recreate the resource, leading to a duplicate resource definition error. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
177 |
37 | 178 An array of resources can also be passed in, and each will be created with the type and parameters specified if it doesn't already exist. |
179 | |
180 `ensure_resource('user', ['dan','alex'], {'ensure' => 'present'})` | |
181 | |
182 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
183 |
37 | 184 * `flatten`: This function flattens any deeply nested arrays and returns a single flat array as a result. For example, `flatten(['a', ['b', ['c']]])` returns ['a','b','c']. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
185 |
37 | 186 * `floor`: Returns the largest integer less than or equal to the argument. |
187 Takes a single numeric value as an argument. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
188 |
37 | 189 * `fqdn_rotate`: Rotates an array a random number of times based on a node's fqdn. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
190 |
37 | 191 * `get_module_path`: Returns the absolute path of the specified module for the current environment. |
192 | |
193 `$module_path = get_module_path('stdlib')` | |
194 | |
195 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
196 |
37 | 197 * `getparam`: Takes a resource reference and the name of the parameter and |
198 returns the value of the resource's parameter. For example, the following code returns 'param_value'. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
199 |
37 | 200 *Example:* |
201 | |
202 ``` | |
203 define example_resource($param) { | |
204 } | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
205 |
37 | 206 example_resource { "example_resource_instance": |
207 param => "param_value" | |
208 } | |
209 | |
210 getparam(Example_resource["example_resource_instance"], "param") | |
211 ``` | |
212 | |
213 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
214 |
37 | 215 * `getvar`: Lookup a variable in a remote namespace. |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
216 |
37 | 217 For example: |
218 | |
219 ``` | |
220 $foo = getvar('site::data::foo') | |
221 # Equivalent to $foo = $site::data::foo | |
222 ``` | |
223 | |
224 This is useful if the namespace itself is stored in a string: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
225 |
37 | 226 ``` |
227 $datalocation = 'site::data' | |
228 $bar = getvar("${datalocation}::bar") | |
229 # Equivalent to $bar = $site::data::bar | |
230 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
231 |
37 | 232 *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
233 |
37 | 234 * `grep`: This function searches through an array and returns any elements that match the provided regular expression. For example, `grep(['aaa','bbb','ccc','aaaddd'], 'aaa')` returns ['aaa','aaaddd']. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
235 |
37 | 236 * `has_interface_with`: Returns boolean based on kind and value: |
237 * macaddress | |
238 * netmask | |
239 * ipaddress | |
240 * network | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
241 |
37 | 242 *Examples:* |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
243 |
37 | 244 ``` |
245 has_interface_with("macaddress", "x:x:x:x:x:x") | |
246 has_interface_with("ipaddress", "127.0.0.1") => true | |
247 ``` | |
248 | |
249 If no kind is given, then the presence of the interface is checked: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
250 |
37 | 251 ``` |
252 has_interface_with("lo") => true | |
253 ``` | |
254 | |
255 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
256 |
37 | 257 * `has_ip_address`: Returns true if the client has the requested IP address on some interface. This function iterates through the `interfaces` fact and checks the `ipaddress_IFACE` facts, performing a simple string comparison. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
258 |
37 | 259 * `has_ip_network`: Returns true if the client has an IP address within the requested network. This function iterates through the 'interfaces' fact and checks the 'network_IFACE' facts, performing a simple string comparision. *Type*: rvalue |
260 | |
261 * `has_key`: Determine if a hash has a certain key value. | |
262 | |
263 *Example*: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
264 |
37 | 265 ``` |
266 $my_hash = {'key_one' => 'value_one'} | |
267 if has_key($my_hash, 'key_two') { | |
268 notice('we will not reach here') | |
269 } | |
270 if has_key($my_hash, 'key_one') { | |
271 notice('this will be printed') | |
272 } | |
273 ``` | |
274 | |
275 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
276 |
37 | 277 * `hash`: This function converts an array into a hash. For example, `hash(['a',1,'b',2,'c',3])` returns {'a'=>1,'b'=>2,'c'=>3}. *Type*: rvalue |
278 | |
279 * `intersection`: This function returns an array an intersection of two. For example, `intersection(["a","b","c"],["b","c","d"])` returns ["b","c"]. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
280 |
37 | 281 * `is_array`: Returns 'true' if the variable passed to this function is an array. *Type*: rvalue |
282 | |
283 * `is_bool`: Returns 'true' if the variable passed to this function is a boolean. *Type*: rvalue | |
284 | |
285 * `is_domain_name`: Returns 'true' if the string passed to this function is a syntactically correct domain name. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
286 |
37 | 287 * `is_float`: Returns 'true' if the variable passed to this function is a float. *Type*: rvalue |
288 | |
289 * `is_function_available`: This function accepts a string as an argument and determines whether the Puppet runtime has access to a function by that name. It returns 'true' if the function exists, 'false' if not. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
290 |
37 | 291 * `is_hash`: Returns 'true' if the variable passed to this function is a hash. *Type*: rvalue |
292 | |
293 * `is_integer`: Returns 'true' if the variable returned to this string is an integer. *Type*: rvalue | |
294 | |
295 * `is_ip_address`: Returns 'true' if the string passed to this function is a valid IP address. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
296 |
37 | 297 * `is_mac_address`: Returns 'true' if the string passed to this function is a valid MAC address. *Type*: rvalue |
298 | |
299 * `is_numeric`: Returns 'true' if the variable passed to this function is a number. *Type*: rvalue | |
300 | |
301 * `is_string`: Returns 'true' if the variable passed to this function is a string. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
302 |
37 | 303 * `join`: This function joins an array into a string using a separator. For example, `join(['a','b','c'], ",")` results in: "a,b,c". *Type*: rvalue |
304 | |
305 * `join_keys_to_values`: This function joins each key of a hash to that key's corresponding value with a separator. Keys and values are cast to strings. The return value is an array in which each element is one joined key/value pair. For example, `join_keys_to_values({'a'=>1,'b'=>2}, " is ")` results in ["a is 1","b is 2"]. *Type*: rvalue | |
306 | |
307 * `keys`: Returns the keys of a hash as an array. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
308 |
37 | 309 * `loadyaml`: Load a YAML file containing an array, string, or hash, and return the data in the corresponding native data type. For example: |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
310 |
37 | 311 ``` |
312 $myhash = loadyaml('/etc/puppet/data/myhash.yaml') | |
313 ``` | |
314 | |
315 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
316 |
37 | 317 * `lstrip`: Strips leading spaces to the left of a string. *Type*: rvalue |
318 | |
319 * `max`: Returns the highest value of all arguments. Requires at least one argument. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
320 |
37 | 321 * `member`: This function determines if a variable is a member of an array. The variable can be either a string, array, or fixnum. For example, `member(['a','b'], 'b')` and `member(['a','b','c'], ['b','c'])` return 'true', while `member(['a','b'], 'c')` and `member(['a','b','c'], ['c','d'])` return 'false'. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
322 |
37 | 323 * `merge`: Merges two or more hashes together and returns the resulting hash. |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
324 |
37 | 325 *Example*: |
326 | |
327 ``` | |
328 $hash1 = {'one' => 1, 'two' => 2} | |
329 $hash2 = {'two' => 'dos', 'three' => 'tres'} | |
330 $merged_hash = merge($hash1, $hash2) | |
331 # The resulting hash is equivalent to: | |
332 # $merged_hash = {'one' => 1, 'two' => 'dos', 'three' => 'tres'} | |
333 ``` | |
334 | |
335 When there is a duplicate key, the key in the rightmost hash "wins." *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
336 |
37 | 337 * `min`: Returns the lowest value of all arguments. Requires at least one argument. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
338 |
37 | 339 * `num2bool`: This function converts a number or a string representation of a number into a true boolean. Zero or anything non-numeric becomes 'false'. Numbers greater than 0 become 'true'. *Type*: rvalue |
340 | |
341 * `parsejson`: This function accepts JSON as a string and converts into the correct Puppet structure. *Type*: rvalue | |
342 | |
343 * `parseyaml`: This function accepts YAML as a string and converts it into the correct Puppet structure. *Type*: rvalue | |
344 | |
345 * `pick`: From a list of values, returns the first value that is not undefined or an empty string. Takes any number of arguments, and raises an error if all values are undefined or empty. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
346 |
37 | 347 ``` |
348 $real_jenkins_version = pick($::jenkins_version, '1.449') | |
349 ``` | |
350 | |
351 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
352 |
37 | 353 * `prefix`: This function applies a prefix to all elements in an array. For example, `prefix(['a','b','c'], 'p')` returns ['pa','pb','pc']. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
354 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
355 |
37 | 356 * `private`: This function sets the current class or definition as private. |
357 Calling the class or definition from outside the current module will fail. For example, `private()` called in class `foo::bar` outputs the following message if class is called from outside module `foo`: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
358 |
37 | 359 ``` |
360 Class foo::bar is private | |
361 ``` | |
362 | |
363 You can specify the error message you want to use: | |
364 | |
365 ``` | |
366 private("You're not supposed to do that!") | |
367 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
368 |
37 | 369 *Type*: statement |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
370 |
37 | 371 * `range`: When given range in the form of '(start, stop)', `range` extrapolates a range as an array. For example, `range("0", "9")` returns [0,1,2,3,4,5,6,7,8,9]. Zero-padded strings are converted to integers automatically, so `range("00", "09")` returns [0,1,2,3,4,5,6,7,8,9]. |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
372 |
37 | 373 Non-integer strings are accepted; `range("a", "c")` returns ["a","b","c"], and `range("host01", "host10")` returns ["host01", "host02", ..., "host09", "host10"]. |
374 | |
375 *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
376 |
37 | 377 * `reject`: This function searches through an array and rejects all elements that match the provided regular expression. For example, `reject(['aaa','bbb','ccc','aaaddd'], 'aaa')` returns ['bbb','ccc']. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
378 |
37 | 379 * `reverse`: Reverses the order of a string or array. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
380 |
37 | 381 * `rstrip`: Strips leading spaces to the right of the string.*Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
382 |
37 | 383 * `shuffle`: Randomizes the order of a string or array elements. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
384 |
37 | 385 * `size`: Returns the number of elements in a string or array. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
386 |
37 | 387 * `sort`: Sorts strings and arrays lexically. *Type*: rvalue |
388 | |
389 * `squeeze`: Returns a new string where runs of the same character that occur in this set are replaced by a single character. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
390 |
37 | 391 * `str2bool`: This converts a string to a boolean. This attempts to convert strings that contain values such as '1', 't', 'y', and 'yes' to 'true' and strings that contain values such as '0', 'f', 'n', and 'no' to 'false'. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
392 |
37 | 393 * `str2saltedsha512`: This converts a string to a salted-SHA512 password hash, used for OS X versions >= 10.7. Given any string, this function returns a hex version of a salted-SHA512 password hash, which can be inserted into your Puppet |
394 manifests as a valid password attribute. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
395 |
37 | 396 * `strftime`: This function returns formatted time. For example, `strftime("%s")` returns the time since epoch, and `strftime("%Y=%m-%d")` returns the date. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
397 |
37 | 398 *Format:* |
399 | |
400 * `%a`: The abbreviated weekday name ('Sun') | |
401 * `%A`: The full weekday name ('Sunday') | |
402 * `%b`: The abbreviated month name ('Jan') | |
403 * `%B`: The full month name ('January') | |
404 * `%c`: The preferred local date and time representation | |
405 * `%C`: Century (20 in 2009) | |
406 * `%d`: Day of the month (01..31) | |
407 * `%D`: Date (%m/%d/%y) | |
408 * `%e`: Day of the month, blank-padded ( 1..31) | |
409 * `%F`: Equivalent to %Y-%m-%d (the ISO 8601 date format) | |
410 * `%h`: Equivalent to %b | |
411 * `%H`: Hour of the day, 24-hour clock (00..23) | |
412 * `%I`: Hour of the day, 12-hour clock (01..12) | |
413 * `%j`: Day of the year (001..366) | |
414 * `%k`: Hour, 24-hour clock, blank-padded ( 0..23) | |
415 * `%l`: Hour, 12-hour clock, blank-padded ( 0..12) | |
416 * `%L`: Millisecond of the second (000..999) | |
417 * `%m`: Month of the year (01..12) | |
418 * `%M`: Minute of the hour (00..59) | |
419 * `%n`: Newline (\n) | |
420 * `%N`: Fractional seconds digits, default is 9 digits (nanosecond) | |
421 * `%3N`: Millisecond (3 digits) | |
422 * `%6N`: Microsecond (6 digits) | |
423 * `%9N`: Nanosecond (9 digits) | |
424 * `%p`: Meridian indicator ('AM' or 'PM') | |
425 * `%P`: Meridian indicator ('am' or 'pm') | |
426 * `%r`: Time, 12-hour (same as %I:%M:%S %p) | |
427 * `%R`: Time, 24-hour (%H:%M) | |
428 * `%s`: Number of seconds since 1970-01-01 00:00:00 UTC. | |
429 * `%S`: Second of the minute (00..60) | |
430 * `%t`: Tab character ( ) | |
431 * `%T`: Time, 24-hour (%H:%M:%S) | |
432 * `%u`: Day of the week as a decimal, Monday being 1. (1..7) | |
433 * `%U`: Week number of the current year, starting with the first Sunday as the first day of the first week (00..53) | |
434 * `%v`: VMS date (%e-%b-%Y) | |
435 * `%V`: Week number of year according to ISO 8601 (01..53) | |
436 * `%W`: Week number of the current year, starting with the first Monday as the first day of the first week (00..53) | |
437 * `%w`: Day of the week (Sunday is 0, 0..6) | |
438 * `%x`: Preferred representation for the date alone, no time | |
439 * `%X`: Preferred representation for the time alone, no date | |
440 * `%y`: Year without a century (00..99) | |
441 * `%Y`: Year with century | |
442 * `%z`: Time zone as hour offset from UTC (e.g. +0900) | |
443 * `%Z`: Time zone name | |
444 * `%%`: Literal '%' character | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
445 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
446 |
37 | 447 * `strip`: This function removes leading and trailing whitespace from a string or from every string inside an array. For example, `strip(" aaa ")` results in "aaa". *Type*: rvalue |
448 | |
449 * `suffix`: This function applies a suffix to all elements in an array. For example, `suffix(['a','b','c'], 'p')` returns ['ap','bp','cp']. *Type*: rvalue | |
450 | |
451 * `swapcase`: This function swaps the existing case of a string. For example, `swapcase("aBcD")` results in "AbCd". *Type*: rvalue | |
452 | |
453 * `time`: This function returns the current time since epoch as an integer. For example, `time()` returns something like '1311972653'. *Type*: rvalue | |
454 | |
455 * `to_bytes`: Converts the argument into bytes, for example 4 kB becomes 4096. | |
456 Takes a single string value as an argument. *Type*: rvalue | |
457 | |
458 * `type`: Returns the type when passed a variable. Type can be a string, array, hash, float, integer, or boolean. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
459 |
37 | 460 * `union`: This function returns a union of two arrays. For example, `union(["a","b","c"],["b","c","d"])` returns ["a","b","c","d"]. |
461 | |
462 * `unique`: This function removes duplicates from strings and arrays. For example, `unique("aabbcc")` returns 'abc'. | |
463 | |
464 You can also use this with arrays. For example, `unique(["a","a","b","b","c","c"])` returns ["a","b","c"]. *Type*: rvalue | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
465 |
37 | 466 * `upcase`: Converts a string or an array of strings to uppercase. For example, `upcase("abcd")` returns 'ABCD'. *Type*: rvalue |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
467 |
37 | 468 * `uriescape`: Urlencodes a string or array of strings. Requires either a single string or an array as an input. *Type*: rvalue |
469 | |
470 * `validate_absolute_path`: Validate that the string represents an absolute path in the filesystem. This function works for Windows and Unix-style paths. | |
471 The following values will pass: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
472 |
37 | 473 ``` |
474 $my_path = "C:/Program Files (x86)/Puppet Labs/Puppet" | |
475 validate_absolute_path($my_path) | |
476 $my_path2 = "/var/lib/puppet" | |
477 validate_absolute_path($my_path2) | |
478 ``` | |
479 | |
480 The following values will fail, causing compilation to abort: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
481 |
37 | 482 ``` |
483 validate_absolute_path(true) | |
484 validate_absolute_path([ 'var/lib/puppet', '/var/foo' ]) | |
485 validate_absolute_path([ '/var/lib/puppet', 'var/foo' ]) | |
486 $undefined = undef | |
487 validate_absolute_path($undefined) | |
488 ``` | |
489 | |
490 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
491 |
37 | 492 * `validate_array`: Validate that all passed values are array data structures. Abort catalog compilation if any value fails this check. |
493 | |
494 The following values will pass: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
495 |
37 | 496 ``` |
497 $my_array = [ 'one', 'two' ] | |
498 validate_array($my_array) | |
499 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
500 |
37 | 501 The following values will fail, causing compilation to abort: |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
502 |
37 | 503 ``` |
504 validate_array(true) | |
505 validate_array('some_string') | |
506 $undefined = undef | |
507 validate_array($undefined) | |
508 ``` | |
509 | |
510 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
511 |
37 | 512 * `validate_augeas`: Performs validation of a string using an Augeas lens. |
513 The first argument of this function should be the string to test, and the second argument should be the name of the Augeas lens to use. If Augeas fails to parse the string with the lens, the compilation aborts with a parse error. | |
514 | |
515 A third optional argument lists paths which should **not** be found in the file. The `$file` variable points to the location of the temporary file being tested in the Augeas tree. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
516 |
37 | 517 For example, to make sure your passwd content never contains user `foo`: |
518 | |
519 ``` | |
520 validate_augeas($passwdcontent, 'Passwd.lns', ['$file/foo']) | |
521 ``` | |
522 | |
523 To ensure that no users use the '/bin/barsh' shell: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
524 |
37 | 525 ``` |
526 validate_augeas($passwdcontent, 'Passwd.lns', ['$file/*[shell="/bin/barsh"]'] | |
527 ``` | |
528 | |
529 You can pass a fourth argument as the error message raised and shown to the user: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
530 |
37 | 531 ``` |
532 validate_augeas($sudoerscontent, 'Sudoers.lns', [], 'Failed to validate sudoers content with Augeas') | |
533 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
534 |
37 | 535 *Type*: statement |
536 | |
537 * `validate_bool`: Validate that all passed values are either true or false. Abort catalog compilation if any value fails this check. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
538 |
37 | 539 The following values will pass: |
540 | |
541 ``` | |
542 $iamtrue = true | |
543 validate_bool(true) | |
544 validate_bool(true, true, false, $iamtrue) | |
545 ``` | |
546 | |
547 The following values will fail, causing compilation to abort: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
548 |
37 | 549 ``` |
550 $some_array = [ true ] | |
551 validate_bool("false") | |
552 validate_bool("true") | |
553 validate_bool($some_array) | |
554 ``` | |
555 | |
556 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
557 |
37 | 558 * `validate_cmd`: Performs validation of a string with an external command. The first argument of this function should be the string to test, and the second argument should be the path to a test command taking a file as last argument. If the command, launched against a tempfile containing the passed string, returns a non-null value, compilation aborts with a parse error. |
559 | |
560 You can pass a third argument as the error message raised and shown to the user: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
561 |
37 | 562 ``` |
563 validate_cmd($sudoerscontent, '/usr/sbin/visudo -c -f', 'Visudo failed to validate sudoers content') | |
564 ``` | |
565 | |
566 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
567 |
37 | 568 * `validate_hash`: Validates that all passed values are hash data structures. Abort catalog compilation if any value fails this check. |
569 | |
570 The following values will pass: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
571 |
37 | 572 ``` |
573 $my_hash = { 'one' => 'two' } | |
574 validate_hash($my_hash) | |
575 ``` | |
576 | |
577 The following values will fail, causing compilation to abort: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
578 |
37 | 579 ``` |
580 validate_hash(true) | |
581 validate_hash('some_string') | |
582 $undefined = undef | |
583 validate_hash($undefined) | |
584 ``` | |
585 | |
586 *Type*: statement | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
587 |
37 | 588 * `validate_re`: Performs simple validation of a string against one or more regular expressions. The first argument of this function should be the string to |
589 test, and the second argument should be a stringified regular expression | |
590 (without the // delimiters) or an array of regular expressions. If none | |
591 of the regular expressions match the string passed in, compilation aborts with a parse error. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
592 |
37 | 593 You can pass a third argument as the error message raised and shown to the user. |
594 | |
595 The following strings validate against the regular expressions: | |
596 | |
597 ``` | |
598 validate_re('one', '^one$') | |
599 validate_re('one', [ '^one', '^two' ]) | |
600 ``` | |
601 | |
602 The following string fails to validate, causing compilation to abort: | |
603 | |
604 ``` | |
605 validate_re('one', [ '^two', '^three' ]) | |
606 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
607 |
37 | 608 To set the error message: |
609 | |
610 ``` | |
611 validate_re($::puppetversion, '^2.7', 'The $puppetversion fact value does not match 2.7') | |
612 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
613 |
37 | 614 *Type*: statement |
615 | |
616 * `validate_slength`: Validates that the first argument is a string (or an array of strings), and is less than or equal to the length of the second argument. It fails if the first argument is not a string or array of strings, or if arg 2 is not convertable to a number. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
617 |
37 | 618 The following values pass: |
619 | |
620 ``` | |
621 validate_slength("discombobulate",17) | |
622 validate_slength(["discombobulate","moo"],17) | |
623 ``` | |
624 | |
625 The following values fail: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
626 |
37 | 627 ``` |
628 validate_slength("discombobulate",1) | |
629 validate_slength(["discombobulate","thermometer"],5) | |
630 ``` | |
631 | |
632 *Type*: statement | |
633 | |
634 * `validate_string`: Validates that all passed values are string data structures. Aborts catalog compilation if any value fails this check. | |
635 | |
636 The following values pass: | |
637 | |
638 ``` | |
639 $my_string = "one two" | |
640 validate_string($my_string, 'three') | |
641 ``` | |
642 | |
643 The following values fail, causing compilation to abort: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
644 |
37 | 645 ``` |
646 validate_string(true) | |
647 validate_string([ 'some', 'array' ]) | |
648 $undefined = undef | |
649 validate_string($undefined) | |
650 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
651 |
37 | 652 *Type*: statement |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
653 |
37 | 654 * `values`: When given a hash, this function returns the values of that hash. |
655 | |
656 *Examples:* | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
657 |
37 | 658 ``` |
659 $hash = { | |
660 'a' => 1, | |
661 'b' => 2, | |
662 'c' => 3, | |
663 } | |
664 values($hash) | |
665 ``` | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
666 |
37 | 667 The example above returns [1,2,3]. |
668 | |
669 *Type*: rvalue | |
670 | |
671 * `values_at`: Finds value inside an array based on location. The first argument is the array you want to analyze, and the second element can be a combination of: | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
672 |
37 | 673 * A single numeric index |
674 * A range in the form of 'start-stop' (eg. 4-9) | |
675 * An array combining the above | |
676 | |
677 For example, `values_at(['a','b','c'], 2)` returns ['c']; `values_at(['a','b','c'], ["0-1"])` returns ['a','b']; and `values_at(['a','b','c','d','e'], [0, "2-3"])` returns ['a','c','d']. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
678 |
37 | 679 *Type*: rvalue |
680 | |
681 * `zip`: Takes one element from first array and merges corresponding elements from second array. This generates a sequence of n-element arrays, where n is one more than the count of arguments. For example, `zip(['1','2','3'],['4','5','6'])` results in ["1", "4"], ["2", "5"], ["3", "6"]. *Type*: rvalue | |
682 | |
683 ##Limitations | |
684 | |
685 As of Puppet Enterprise version 3.7, the stdlib module is no longer included in PE. PE users should install the most recent release of stdlib for compatibility with Puppet modules. | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
686 |
37 | 687 ###Version Compatibility |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
688 |
37 | 689 Versions | Puppet 2.6 | Puppet 2.7 | Puppet 3.x | Puppet 4.x | |
690 :---------------|:-----:|:---:|:---:|:----: | |
691 **stdlib 2.x** | **yes** | **yes** | no | no | |
692 **stdlib 3.x** | no | **yes** | **yes** | no | |
693 **stdlib 4.x** | no | **yes** | **yes** | no | |
694 **stdlib 5.x** | no | no | **yes** | **yes** | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
695 |
37 | 696 **stdlib 5.x**: When released, stdlib 5.x will drop support for Puppet 2.7.x. Please see [this discussion](https://github.com/puppetlabs/puppetlabs-stdlib/pull/176#issuecomment-30251414). |
697 | |
698 ##Development | |
699 | |
700 Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. | |
701 | |
702 We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. | |
703 | |
704 You can read the complete module contribution guide on the [Puppet Labs wiki](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing). | |
705 | |
706 To report or research a bug with any part of this module, please go to | |
707 [http://tickets.puppetlabs.com/browse/PUP](http://tickets.puppetlabs.com/browse/PUP). | |
708 | |
709 ##Contributors | |
710 | |
711 The list of contributors can be found at: https://github.com/puppetlabs/puppetlabs-stdlib/graphs/contributors | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
712 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
713 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
714 |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
715 |