Gajillion schrieb: > Hi, > I'm a newb to puppet but have a good deal of experience with > CFEngine. We want to replace CFEngine in our environment because of > its monolithic nature. As a proof of concept, I'd like to duplicate a > particular function we've always had trouble with in CFEngine - > installing HP PSP on our Redhat based ProLiant series servers. > > The logic is relatively simple, but execution can get complicated due > to inconsistencies in Redhat package dependency handling: > > 1) Look for installation tool dependencies (gcc, rpm-build, kernel- > headers, etc.) > 2) Install required tools that are missing > 3) Run the HP PSP installation script with pre-packaged XML descriptor > file > 4) (and this is the tricky part) Uninstall any tools installed in step > 2. > > In other words, the output of "rpm -q -a" before step 2 and after step > 4 should look identical for the most part, save the actual HP packages > installed via the PSP install script. DEV boxes should still have gcc > installed, but PROD boxes shouldn't. > > I've got the "Pulling Strings with Puppet" book but I'm afraid it > doesn't go into as much depth as a I need for this. I've looked at > some other recipes and the installation part is clear, but the removal > of packages that were not previously installed is a bit tricky and > haven't seen anything like that. > > Anyone have some clues where I should be looking? Anything with any > of those attributes out there that I can use to hobble together a > prototype proof of concept? Thanks,
puppet is a steady-state management system, where you specify the target and puppet works out how to get there. Installing and removing packages in a single step doesn't fit into that model at all. If there is no possibility at all to pre-compile packages from the PSP (e.g. by re-using an imaging server or stow or something similar) then I would a) hate the vendor and b) create a single script doing an unattended PSP install which is called by puppet when needed. If you really want to force this into puppet proper, you need a list of all packages needed by the installation, and -- for each server -- a list of packages out of this set that should be always installed. Call the first list $necessary and the latter $always. The list of unneeded packages, $removables, is obviously $necessary - $always. Adjust for the PSP's dependencies as necessary. Now you can do something like this: # execute a script that does a "yum install $necessary" # and then installs the psp exec { "/usr/local/bin/psp_install": } package { $removeables: ensure => purged, require => Exec["/usr/local/bin/psp_install"] } Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---