This afternoon I started looking at cfengine. In very little time, I’ve already set up rules that can bring a system from pretty much cdebootstrap state up to a minimal production system in our environment. I’ve still got a little ways to go, but it’s already hacking on /etc/hosts, hosts.deny, sources.list, installing appropriate Debian packages for our systems, etc.
It’s come a long way since I last looked at it six years ago.
One thing I can’t figure out…
I have a /etc/bacula/bacula-fd.conf file that contains, among other things, this:
Director { Name = backup-dir Password = "foo" } Director { Name = backup-mon Password = "bar" Monitor = yes }
I can’t figure out how to make cfengine delete just that second section. I tried this:
BeginGroupIfLineMatching " name = .+-mon" IncrementPointer "-1" DeleteToLineMatching "\}" DeleteNLines "1" EndGroup
But it seems that the pointer is never actually being decremented, even when examined under verbose mode. That is, it leaves the leading “Director {” line in the file.