file_augeas
Manage files using Augeas - in beta.
⚙️ Compatible targets: Linux
Parameters
| Name | Documentation |
|---|---|
| path | Path of the file. This parameter is required. |
| script | Commands to run on the file. This parameter is required. |
| if_script | Only run the script if this script succeeds. This parameter is optional. |
| lens | Lens to use (defaults to detecting the lens based on file path). This parameter is optional. |
| show_content | Allow reports to contain extracts of the file content (defaults to true). Choices:
This parameter is optional. |
Outcome conditions
You need to replace ${path} with its actual canonified value.
- ✅ Ok:
file_augeas_${path}_ok- ☑️ Already compliant:
file_augeas_${path}_kept - 🟨 Repaired:
file_augeas_${path}_repaired
- ☑️ Already compliant:
- ❌ Error:
file_augeas_${path}_error
Example
method: file_augeas
params:
if_script: OPTIONAL_VALUE
path: VALUE
show_content: 'true'
script: VALUE
lens: OPTIONAL_VALUE
Documentation
Augeas is a tool that provides an abstraction layer for all the complexities that turn around editing files with regular expressions.
This method is a wrapper around Rudder Augeas module.
The method has in total 5 parameters:
-
Path: Path of the fileexample:
/etc/hosts -
Script: rAugeas script to run on the file. The module adds audit capabilities to Augeas by introducing an additional directive calledcheck.example:
check /files/etc/hosts/1/ipaddr is ipv4 -
If_script: Only run the script if this rAugeas script succeedsexample:
check /files/etc/hosts/1/canonical ~ localhost -
Lens: Lens to use (defaults to detecting the lens based on file path) For a list of supported lenses refer to the Augeas documentationexample:
Hosts -
Show_content: Allow reports to contain extracts of the file content (defaults to true)example:
true