The following syntax should work, according to documentation and examples:
----------
body common control {
bundlesequence => { "test" };
}
bundle agent test {
files:
"/tmp/yum.conf"
edit_line => append_after_main;
}
bundle edit_line append_after_main {
insert_lines:
"Please insert me" location => yum_conf;
}
body location yum_conf {
before_after => "after";
first_last => "first";
select_line_matching => "\[main\]";
}
----------
This doesn't work unfortunatly. It appends the line at the end of the file
each time it finds the regexp. So I end up with multiple lines at the end
of the file, instead of one line after the locator.
My working cfengine 2 syntax is this:
----------
editfiles:
{
/etc/yum.conf
BeginGroupIfNoSuchLine "Please insert me"
LocateLineMatching "\[main\]"
InsertLine "Please insert me"
EndGroup
}
----------
Hope someone can help me out. Thanks in advance.
Kind regards,
Dennis
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine