On 08/28/2014 08:06 AM, cfday wrote:
> Is it possible not only to raise a warning if there were changes but
> rather to execute a command, e.g. a script? Maybe it will help
> classes => if_repaired("changes") in the file promise?
Yes the following example should work for you.
#########################################################
bundle agent example
{
files:
"/etc/example" # Directory to monitor for changes.
changes => detect_all_change,
depth_search => recurse("inf"),
classes => scoped_classes_generic("bundle", "etc_example");
commands:
etc_example_repaired::
"/bin/echo"
args => "Run a command";
}
#########################################################
body changes detect_all_change
{
report_changes => "all";
update_hashes => "yes";
}
#########################################################
Additionally I believe there are automatic classes that are defined when
changes are detected. Unfortunately I am unable to find reference to
those in the documentation.