# Reference ## Table of Contents **Resource types** * [`augeas`](#augeas): Apply a change or an array of changes to the filesystem using the augeas tool. Requires: - [Augeas](http://www.augeas.net) - The ruby-augea ## Resource types ### augeas Apply a change or an array of changes to the filesystem using the augeas tool. Requires: - [Augeas](http://www.augeas.net) - 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", } #### 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. ##### `name` namevar The name of this task. Used for uniqueness. ##### `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: '' ##### `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 ` * `values include ` * `values not_include ` * `values == ` * `values != ` * `match size ` * `match include ` * `match not_include ` * `match == ` * `match != ` where: * `AUGEAS_PATH` is a valid path scoped by the context * `MATCH_PATH` is a valid match syntax scoped by the context * `COMPARATOR` is one of `>, >=, !=, ==, <=,` or `<` * `STRING` is a string * `INT` is a number * `AN_ARRAY` is in the form `['a string', 'another']` Default value: '' ##### `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 ` --- Sets the value `VALUE` at location `PATH` * `setm ` --- Sets multiple nodes (matching `SUB` relative to `PATH`) to `VALUE` * `rm ` --- Removes the node at location `PATH` * `remove ` --- Synonym for `rm` * `clear ` --- Sets the node at `PATH` to `NULL`, creating it if needed * `clearm ` --- Sets multiple nodes (matching `SUB` relative to `PATH`) to `NULL` * `touch ` --- Creates `PATH` with the value `NULL` if it does not exist * `ins