On Mon, Jan 26, 2009 at 10:18 AM, nicolas <[email protected]> wrote: > > Hello, > > I'm currently prototyping the use of Puppet to manage a bunch of > home-made applications on a lot of servers. > As our applications evolves frequently and multiples versions can > be used at the same time, we use classes that include version in their > name, like "myApplication_1-2-0" > > A typical application class like "myApplication_1-2-0" contains for > example a package to install, some configuration files as templates, a > crontab, a service definition and a mount point > > When I want to deploy version 1-3-0 of my application on a node, to > replace version 1-2-0, the standard way to do with puppet, as I > understand it, would be : > - node initially contains "include myApplication_1-2-0" > - I edit node to contains "include myApplication_1-2-0::remove" > where myApplication_1-2-0::remove is a class that removes everything > myApplication_1-2-0 installed > - I apply the config to node > - I edit the node to contains "include myApplication_1-3-0" > - I apply the config to node > > But on node, there is the localconfig.yaml file (usually in /var/lib/ > puppet/) that contains everything needed to know what should be > removed when myApplication_1-2-0 is installed. > I was thinking of automating this step like this : > - retrieve config from master > - retrieve local config (in localconfig.yaml) > - if an application has not the same version on the master and > locally then > a) change everything to absent for version which is locally > installed > b) apply this, so local version is removed > c) then apply config from master, so new version is installed > > Do you think it's a good approach ? > If not, do you know an alternate ways to manage applications that have > several versions ? > > thanks for your answers > nicolas > I can see atleast one big got-ya with this approach. It would work okay with packages using ensure => present and that don't get update by the local update utility. But anything using ensure => latest or that gets updated by the local update utility is going to get hosed. I find the best approach with pacakges that need a lot of configs that change version to version is either wrap it all up in an RPM or use somethinglike the generate function to create config files on the file. In most cases, though all that really needs to be done is update the template and config files, they will replace the old ones and tell puppet to ensure => present with the version number you want.
About the only time you need to do a wholesale application removal is when you want to remove it from a system. If you have lots of applications that are just ugly to install an dremove you may want to take a look at Stow. Evan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
