Installing packages with cfengine

From UGCS
(Difference between revisions)
Jump to: navigation, search
(New page: 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 ta...)
 
(How to use it)
Line 9: Line 9:
 
# Install the package on a test machine, and answer all the debconf values to your liking
 
# Install the package on a test machine, and answer all the debconf values to your liking
 
# Copy the debconf database to demeter:/srv/cfengine/hosts/debconf/db so that cfengine can distribute it
 
# Copy the debconf database to demeter:/srv/cfengine/hosts/debconf/db so that cfengine can distribute it
# 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.
+
# 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 shellserver-packages.conf.
 
# Test your stuff on another machine.  On that machine, run cfagent -vf update.conf && cfagent -vf packages.conf  Make sure it works correctly
 
# Test your stuff on another machine.  On that machine, run cfagent -vf update.conf && cfagent -vf packages.conf  Make sure it works correctly
 
# Run it on all machines: cfrun -- -vf update.conf && cfrun -- -vf packages.conf
 
# Run it on all machines: cfrun -- -vf update.conf && cfrun -- -vf packages.conf
 
# Run it on machines that aren't in cfrun (charon, hera, zeus)
 
# Run it on machines that aren't in cfrun (charon, hera, zeus)

Revision as of 06:20, 18 August 2009

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 shellserver-packages.conf.
  4. Test your stuff on another machine. On that machine, run cfagent -vf update.conf && cfagent -vf packages.conf Make sure it works correctly
  5. Run it on all machines: cfrun -- -vf update.conf && cfrun -- -vf packages.conf
  6. Run it on machines that aren't in cfrun (charon, hera, zeus)
Personal tools