Various FreeBSD bits...

Sean Chittenden
Mon, 12 Nov 2007 17:30:31 -0000

I just drudged through a bit of the archives and see a FreeBSD bits
floating in there that are of some value, but aren''t on the wiki.  I
posted a few bits on the wiki regarding some FreeBSD cobbling that
I''ve done recently and hope that folk find it of use (and start
posting their useful bits there as well).

http://reductivelabs.com/trac/puppet/wiki/PuppetFreeBSD

The ''define shell_config()'' bit is probably of interest if
you''ve got
bare metal servers without perl installed since it makes use of only
FreeBSD base utilities (sed/grep) and handles uniquification of shell
variables (handy for rc.conf*, periodic.conf, etc).

Could someone post the "defacto" skeleton recipe for FreeBSD to the
wiki that installs portupgrade if it''s not installed, and installs a
few packages bia portinstall using the ports provider?  I''ve got a
"portinstall" macro that encompasses make, portinstall, and pkg_add...
but am still grappling with but I''m getting hung up on how to write a
''postinstall'' script that executes a (set of)? command(s)?,
but only
does this once.  portaudit being my guinea pig.  I''m still using
periodic (though it''s feeling pretty outmoded at this point in time)
and am using a definition like:

class package-portaudit {
#  package { portaudit: ensure => present, provider => freebsd }
   portinstall {
     portaudit:
       port => ''portaudit'',
       method => ''make'',
       origin => ''ports-mgmt/portaudit'',
       postinstall => ''/usr/local/sbin/portaudit -Fda'';
   }

   periodic_conf {
     port_periodic_daily_portaudit_enable: key =>
daily_status_security_portaudit_enable, value => YES;
   }
}

periodic_conf() is defined on the above wiki and portinstall is a
definition that I''m hacking together.  I''ve thought about
making
portinstall a "service" and the postinstall a refresh cmd, but that
feels like I''m trying to take a sledge hammer to this problem.
What''s
the elegant solution to this?  <:~)  Thanks in advance.  -sc

--
Sean Chittenden
sean@chittenden.org