Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 6871123591698337ee06efa6a871ef7b > files > 54

cfengine3-base-3.0.2-1mdv2010.0.i586.rpm


#######################################################
#
# Insert a number of lines and trigger a followup if edited
#
#######################################################

body common control

{
any::

  bundlesequence  => { "insert" };   
}


#######################################################

bundle agent insert

{
vars:

  "v" string => "
                One potato
                Two potato
                Three potahto
                Four
                ";
 
files:

  "/tmp/test_insert"

     edit_line => Insert("$(insert.v)"),
     edit_defaults => empty,
     classes => trigger("edited");

commands:

 edited::

  "/bin/echo make bananas";

reports:

  edited::

    "The potatoes are bananas";

}

#######################################################
# For the library
#######################################################

bundle edit_line Insert(name)

{
insert_lines:

  "Begin$(const.n) $(name)$(const.n)End";

}

#######################################################

body edit_defaults empty

{
empty_file_before_editing => "true";
}

#######################################################

body classes trigger(x)

{
promise_repaired => { "$(x)" };
}