Editing Lines In Configuration Files Via CFEngine
Posted by Tres Fri, 07 Jul 2006 13:56:00 GMT
The easiest way to make sure that your configuration files have the right stuff in them is to use CFEngine’s editfiles: section to remove unwanted lines, and to add lines to them.
The following shows how to remove lines from /etc/rc.conf by using CFEngine’s DeleteLinesContaining command:
editfiles:
-
serviceadd::
-
{
/etc/rc.conf
DeleteLinesContaining "lpd_enable=\"YES\""
}
This next example shows how to add a line to a file via CFEngine if the line doesn’t already exist in the file:
editfiles:
-
serviceadd::
-
{
/etc/rc.conf
AppendIfNoSuchLine "cloned_interfaces=\"vlan299 vlan301 carp0\""
}