Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

file_augeas

Manage files using Augeas - in beta.

⚙️ Compatible targets: Linux

Parameters

NameDocumentation
pathPath of the file.

This parameter is required.
scriptCommands to run on the file.

This parameter is required.
if_scriptOnly run the script if this script succeeds.

This parameter is optional.
lensLens to use (defaults to detecting the lens based on file path).

This parameter is optional.
show_contentAllow reports to contain extracts of the file content (defaults to true).

Choices:
  • true
  • false

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
  • ❌ Error: file_augeas_${path}_error

Example

method: file_augeas
params:
  path: VALUE
  script: VALUE
  show_content: 'true'
  if_script: OPTIONAL_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 file

    example: /etc/hosts

  • Script: rAugeas script to run on the file. The module adds audit capabilities to Augeas by introducing an additional directive called check.

    example: check /files/etc/hosts/1/ipaddr is ipv4

  • If_script: Only run the script if this rAugeas script succeeds

    example: 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 documentation

    example: Hosts

  • Show_content: Allow reports to contain extracts of the file content (defaults to true)

    example: true