Installing packages with cfengine
(→How to use it) |
|||
| (3 intermediate revisions by one user not shown) | |||
| 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. If it is just for shellservers, add it to | + | # 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. |
| − | # Test your stuff on another machine. On that machine, run cfagent - | + | # Test your stuff on another machine. On that machine, run cfagent -v Make sure it works correctly |
| − | # Run it on all machines: cfrun | + | # Run it on all machines: cfrun |
# Run it on machines that aren't in cfrun (charon, hera, zeus) | # 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 <packagename> | ||
| + | |||
| + | 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/<hostname>.log and see what the problem is. | ||
| + | |||
| + | [[Category:Sysadmin_Documentation]] | ||
Latest revision as of 20:03, 26 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
- 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
- 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.
- Test your stuff on another machine. On that machine, run cfagent -v Make sure it works correctly
- Run it on all machines: cfrun
- 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 <packagename>
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/<hostname>.log and see what the problem is.