28
|
1 |
# Augeas Puppet module |
|
2 |
|
|
3 |
[](https://forge.puppetlabs.com/camptocamp/augeas) |
|
4 |
[](https://forge.puppetlabs.com/camptocamp/augeas) |
|
5 |
[](https://travis-ci.org/camptocamp/puppet-augeas) |
|
6 |
[](https://gemnasium.com/camptocamp/puppet-augeas) |
|
7 |
[](http://www.camptocamp.com) |
|
8 |
|
|
9 |
**Install and configure Augeas.** |
|
10 |
|
|
11 |
This module is provided by [Camptocamp](http://www.camptocamp.com/) |
|
12 |
|
|
13 |
## Usage |
|
14 |
|
|
15 |
Simple usage: |
|
16 |
|
|
17 |
include augeas |
|
18 |
|
|
19 |
### Classes |
|
20 |
|
|
21 |
The module provides an `augeas` class which installs and configures Augeas. |
|
22 |
|
|
23 |
|
|
24 |
* lets you force the augeas version by defining `$augeas_version`, otherwise puppet will |
|
25 |
only ensure the packages are present; |
|
26 |
* lets you force the ruby library version by defining `$augeas_ruby_version`, otherwise puppet will |
|
27 |
only ensure the libaugeas-ruby version will be installed according to internal critera; |
|
28 |
* provides an `augeas()` master-side function to manipulate strings using Augeas; |
|
29 |
|
|
30 |
Note: the `augeas` class realizes all `augeas` resources in order to ensure they are managed after the required Augeas packages. |
|
31 |
|
|
32 |
|
|
33 |
### Definitions |
|
34 |
|
|
35 |
#### `augeas::lens` |
|
36 |
|
|
37 |
The `augeas::lens` definition allows you to deploy an Augeas lens and any associated test files, running unit tests and not installing if they fail: |
|
38 |
|
|
39 |
Parameters: |
|
40 |
|
|
41 |
- *ensure*: present/absent |
|
42 |
- *lens_content*: the content of the lens |
|
43 |
- *lens_source*: deprecated, the source for the lens |
|
44 |
- *test_content*: optionally, the content of the test file |
|
45 |
- *test_source*: deprecated, the source for the test file. |
|
46 |
- *stock_since*: optionally, indicate in which version of Augeas |
|
47 |
the lens became stock, so it will not be deployed above that version. |
|
48 |
|
|
49 |
Example usage: |
|
50 |
|
|
51 |
```puppet |
|
52 |
augeas::lens { 'networkmanager': |
|
53 |
lens_content => file('networkmanager/lenses/networkmanager.aug'), |
|
54 |
test_content => file('networkmanager/lenses/test_networkmanager.aug'), |
|
55 |
stock_since => '1.0.0', |
|
56 |
} |
|
57 |
``` |
|
58 |
|
|
59 |
### Functions |
|
60 |
|
|
61 |
#### `augeas()` |
|
62 |
|
|
63 |
Modifies a string using Augeas. |
|
64 |
|
|
65 |
*Example:* |
|
66 |
|
|
67 |
augeas("proc /proc proc nodev,noexec,nosuid 0 0\n", 'Fstab.lns', ['rm ./1/opt[3]']) |
|
68 |
|
|
69 |
Would result in: |
|
70 |
|
|
71 |
"proc /proc proc nodev,noexec 0 0\n" |
|
72 |
|
|
73 |
|
|
74 |
- *Type*: rvalue |
|
75 |
|
|
76 |
## Contributing |
|
77 |
|
|
78 |
Please report bugs and feature request using [GitHub issue |
|
79 |
tracker](https://github.com/camptocamp/puppet-augeas/issues). |
|
80 |
|
|
81 |
For pull requests, it is very much appreciated to check your Puppet manifest |
|
82 |
with [puppet-lint](https://github.com/camptocamp/puppet-augeas/issues) to follow the recommended Puppet style guidelines from the |
|
83 |
[Puppet Labs style guide](http://docs.puppetlabs.com/guides/style_guide.html). |