NOTE: This page was generated from the Puppet source code on 2017-08-17 12:24:28 -0500
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':
name => # (namevar) The name of this task. Used for...
changes => # The changes which should be applied to the...
context => # Optional context path. This value is prepended...
force => # Optional command to force the augeas type to...
incl => # Load only a specific file, e.g. `/etc/hosts`...
lens => # Use a specific lens, e.g. `Hosts.lns`. When this
load_path => # Optional colon-separated list or array of...
onlyif => # Optional augeas command and comparisons to...
provider => # The specific backend to use for this `augeas...
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.
}
name
(Namevar: If omitted, this attribute’s value defaults to the resource’s title.)
The name of this task. Used for uniqueness.
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 valueVALUE
at locationPATH
setm <PATH> <SUB> <VALUE>
— Sets multiple nodes (matchingSUB
relative toPATH
) toVALUE
rm <PATH>
— Removes the node at locationPATH
remove <PATH>
— Synonym forrm
clear <PATH>
— Sets the node atPATH
toNULL
, creating it if neededclearm <PATH> <SUB>
— Sets multiple nodes (matchingSUB
relative toPATH
) toNULL
touch <PATH>
— CreatesPATH
with the valueNULL
if it does not existins <LABEL> (before|after) <PATH>
— Inserts an empty nodeLABEL
either before or afterPATH
.insert <LABEL> <WHERE> <PATH>
— Synonym forins
mv <PATH> <OTHER PATH>
— Moves a node atPATH
to the new locationOTHER PATH
move <PATH> <OTHER PATH>
— Synonym formv
rename <PATH> <LABEL>
— Rename a node atPATH
to a newLABEL
defvar <NAME> <PATH>
— Sets Augeas variable$NAME
toPATH
defnode <NAME> <PATH> <VALUE>
— Sets Augeas variable$NAME
toPATH
, creating it withVALUE
if needed
If the context
parameter is set, that value is prepended to any relative PATH
s.
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.
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.
incl
Load only a specific file, e.g. /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, e.g. 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.
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 and then `get` to retrieve the values from each of the returned paths.
Supported onlyif syntax:
get <AUGEAS_PATH> <COMPARATOR> <STRING>
values <MATCH_PATH> include <STRING>
values <MATCH_PATH> not_include <STRING>
values <MATCH_PATH> == <AN_ARRAY>
values <MATCH_PATH> != <AN_ARRAY>
match <MATCH_PATH> size <COMPARATOR> <INT>
match <MATCH_PATH> include <STRING>
match <MATCH_PATH> not_include <STRING>
match <MATCH_PATH> == <AN_ARRAY>
match <MATCH_PATH> != <AN_ARRAY>
where:
AUGEAS_PATH
is a valid path scoped by the contextMATCH_PATH
is a valid match syntax scoped by the contextCOMPARATOR
is one of>, >=, !=, ==, <=,
or<
STRING
is a stringINT
is a numberAN_ARRAY
is in the form['a string', 'another']
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.
Available providers are:
returns
(Property: This attribute represents concrete state on the target system.)
The expected return code from the augeas command. Should not be set.
root
A file system path; all files loaded by Augeas are loaded underneath root
.
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.
Valid values are true
, false
, yes
, no
.
type_check
Whether augeas should perform typechecking. Defaults to false.
Valid values are true
, false
.
Providers
augeas
- Supported features:
execute_changes
,need_to_run?
,parse_commands
.
Provider Features
Available features:
execute_changes
— Actually make the changesneed_to_run?
— If the command should runparse_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 2017-08-17 12:24:28 -0500