Installing packages with cfengine

Installing packages with cfengine can be very powerful and a huge time-saver, but it needs to be set up correctly to work.

=Overview= CFengine has built-in package manager support. It takes a list of packages and some information about them (version number, etc) and sees if it needs to install them. If it does, it runs a given install command.

Debian packages use a system called "Debconf" to configure them. This is the piece of apt that prompts you during installation for the various things it wants to know. We have it set up so that it saves these values in flat-text files in /var/cache/debconf/db. Cfengine can copy this database over to all the other machines so they can have pre-seeded debconf values. We then give aptitude an option (via the cfengine install command) so that it will never prompt.

=How to use it=
 * 1) Install the package on a test machine, and answer all the debconf values to your liking
 * 2) Copy the debconf database to demeter:/srv/cfengine/hosts/debconf/db so that cfengine can distribute it
 * 3) Add your package to demeter:/srv/cfengine/global/inputs/packages.conf.  See the other packages in there for the format, and see the cfengine documentation if you have more questions.  If it is just for shellservers, add it to shellserverpackages.conf.
 * 4) Test your stuff on another machine.  On that machine, run cfagent -v  Make sure it works correctly
 * 5) Run it on all machines: cfrun
 * 6) Run it on machines that aren't in cfrun (charon, hera, zeus)

After this, you need to check to make sure it got installed right mssh coreserver dpkg -l

If it didn't, you should be able to fix it by running cfrun again. If that still doesn't work, check demeter:/tmp/cfrun/ .log and see what the problem is.