Reference

Table of Contents

Resource types

Resource types

augeas

Requires:

Examples

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",
}

Properties

The following properties are available in the augeas type.

returns

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

Default value: 0

Parameters

The following parameters are available in the augeas type.

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:

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

context

Optional context path. This value is prepended to the paths of all changes if the path is relative. If the incl parameter is set, defaults to /files + incl; otherwise, defaults to the empty string.

Default value: ''

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 value: false

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.

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.

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 value: ''

name

namevar

The name of this task. Used for uniqueness.

onlyif

Optional augeas command and comparisons to control the execution of this type.

Note: values is not an actual augeas API command. It calls match to retrieve an array of paths in <MATCH_PATH> and then get to retrieve the values from each of the returned paths.

Supported onlyif syntax:

where:

Default value: ''

provider

The specific backend to use for this augeas resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

root

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

Default value: /

show_diff

Valid values: true, false, yes, no

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 value: true

type_check

Valid values: true, false

Whether augeas should perform typechecking. Defaults to false.

Default value: false