On Jan 27, 2009, at 5:45 AM, nicolas 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 ?
I think it''d be easier to make your installation classes configurable
- have something like a definition built up with a switch for
installation and removal:
define myapp($ensure) {
package { "myapp-$name": ensure => $ensure }
...
}
Then you install one version:
myapp { "3.0": ensure => present }
And remove the other:
myapp { "2.0": ensure => absent }
This requires more work on your buildup, and would also require that
the resource list in each class be unique, but you''ll need that
anyway, I think.
--
I don''t know the key to success, but the key to failure is trying to
please everybody. -- Bill Cosby
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
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
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---