Open source Puppet documentation

NOTE: This page was generated from the Puppet source code on 2018-03-20 07:07:39 -0700

augeas

Description

Apply a change or an array of changes to the filesystem using the augeas tool.

Requires:

  • Augeas
  • The ruby-augeas bindings

Sample usage with a string:

augeas{"test1" :
  context => "/files/etc/sysconfig/firstboot",
  changes => "set RUN_FIRSTBOOT YES",
  onlyif  => "match other_value size > 0",
}

Sample usage with an array and custom lenses:

augeas{"jboss_conf":
  context   => "/files",
  changes   => [
      "set etc/jbossas/jbossas.conf/JBOSS_IP $ipaddress",
      "set etc/jbossas/jbossas.conf/JAVA_HOME /usr",
    ],
  load_path => "$/usr/share/jbossas/lenses",
}

Attributes

augeas { 'resource title':
  changes    => # The changes which should be applied to the...
  force      => # Optional command to force the augeas type to...
  incl       => # Load only a specific file, such as `/etc/hosts`. 
  lens       => # Use a specific lens, such as `Hosts.lns`. When...
  load_path  => # Optional colon-separated list or array of...
  returns    => # The expected return code from the augeas...
  root       => # A file system path; all files loaded by Augeas...
  show_diff  => # Whether to display differences when the file...
  type_check => # Whether augeas should perform typechecking...
  # ...plus any applicable metaparameters.
}

changes

The changes which should be applied to the filesystem. This can be a command or an array of commands. The following commands are supported:

  • set <PATH> <VALUE> — Sets the value VALUE at location PATH
  • setm <PATH> <SUB> <VALUE> — Sets multiple nodes (matching SUB relative to PATH) to VALUE
  • rm <PATH> — Removes the node at location PATH
  • remove <PATH> — Synonym for rm
  • clear <PATH> — Sets the node at PATH to NULL, creating it if needed
  • clearm <PATH> <SUB> — Sets multiple nodes (matching SUB relative to PATH) to NULL
  • touch <PATH> — Creates PATH with the value NULL if it does not exist
  • ins <LABEL> (before|after) <PATH> — Inserts an empty node LABEL either before or after PATH.
  • insert <LABEL> <WHERE> <PATH> — Synonym for ins
  • mv <PATH> <OTHER PATH> — Moves a node at PATH to the new location OTHER PATH
  • move <PATH> <OTHER PATH> — Synonym for mv
  • rename <PATH> <LABEL> — Rename a node at PATH to a new LABEL
  • defvar <NAME> <PATH> — Sets Augeas variable $NAME to PATH
  • defnode <NAME> <PATH> <VALUE> — Sets Augeas variable $NAME to PATH, creating it with VALUE if needed

If the context parameter is set, that value is prepended to any relative PATHs.

(↑ Back to augeas attributes)

force

Optional command to force the augeas type to execute even if it thinks changes will not be made. This does not override the onlyif parameter.

Default: false

(↑ Back to augeas attributes)

incl

Load only a specific file, such as /etc/hosts. This can greatly speed up the execution the resource. When this parameter is set, you must also set the lens parameter to indicate which lens to use.

(↑ Back to augeas attributes)

lens

Use a specific lens, such as Hosts.lns. When this parameter is set, you must also set the incl parameter to indicate which file to load. The Augeas documentation includes a list of available lenses.

(↑ Back to augeas attributes)

load_path

Optional colon-separated list or array of directories; these directories are searched for schema definitions. The agent’s $libdir/augeas/lenses path will always be added to support pluginsync.

Default: ""

(↑ Back to augeas attributes)

returns

(Property: This attribute represents concrete state on the target system.)

The expected return code from the augeas command. Should not be set.

Default: 0

(↑ Back to augeas attributes)

root

A file system path; all files loaded by Augeas are loaded underneath root.

Default: /

(↑ Back to augeas attributes)

show_diff

Whether to display differences when the file changes, defaulting to true. This parameter is useful for files that may contain passwords or other secret data, which might otherwise be included in Puppet reports or other insecure outputs. If the global show_diff setting is false, then no diffs will be shown even if this parameter is true.

Default: true

Allowed values:

  • true
  • false
  • yes
  • no

(↑ Back to augeas attributes)

type_check

Whether augeas should perform typechecking. Defaults to false.

Default: false

Allowed values:

  • true
  • false

(↑ Back to augeas attributes)

Providers

augeas

  • Confined to: feature == augeas

Provider Features

Available features:

  • execute_changes — Actually make the changes
  • need_to_run? — If the command should run
  • parse_commands — Parse the command string

Provider support:

Provider execute changes need to run? parse commands
augeas X X X

NOTE: This page was generated from the Puppet source code on 2018-03-20 07:07:39 -0700

Back to top