[Puppet Users] Adding Lines to *Existing* Files?

nickt
Mon, 01 Nov 2010 22:29:48 -0000

What, if any, is the best way to programatically add lines to an
existing file with puppet?  What I''m going for precisely is adding
lines to either /etc/passwd and /etc/shadow (on Solaris) or /etc/
security/access.conf (on Linux) at "run" time.  Adding lines to wind
up with files along these lines, +@MyGroupToLetIn:x:::::

/etc/passwd
.
.
+@myldapgroup:x:::::
-:x:::::

/etc/shadow
.
.
+@myldapgroup:x:12345:::::


/etc/security/access.conf
.
.
+:@myldapgroup:ALL

I guess I could use a template, but unless I want to try to keep on
top of what those files contain in dozens of client machines that
seems pretty painful.  Maybe the concat module?