In an attempt to simplify my life, I created a Puppet module for Tomcat5 (and I hope to be able to contribute it), with a function called tomcat5_manager(). This function does 2 things - ensure a package exists, ensure 2 files exist. However, when I attempt to control two separate instances of tomcat (call them imaginatively A and B), Puppet throws an error of: err: Could not retrieve catalog: Puppet::Parser::AST::Resource failed with error ArgumentError: Duplicate definition: Package[tomcat5-admin-webapps] is already defined in file /etc/puppet/modules/tomcat5/manifests/os/centos-5.pp at line 16; cannot redefine at /etc/puppet/modules/tomcat5/manifests/os/centos-5.pp:16 on node lhm-srv-app01.impello.co.uk. This makes sense, there are two calls to that package. However, I need a way to ensure that package is install as part of the module, but only when that define is used - I don''t want it installed normally. Ideas on how I can achieve this goal? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Am 18.07.2008 um 12:19 schrieb Duncan Hill:> This makes sense, there are two calls to that package. However, I > need a way to ensure that package is install as part of the module, > but only when that define is used - I don''t want it installed > normally. > > Ideas on how I can achieve this goal?Sounds like something that would benefit from being a virtual resource http://reductivelabs.com/trac/puppet/wiki/VirtualResources . Felix --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi> In an attempt to simplify my life, I created a Puppet module for > Tomcat5 (and I hope to be able to contribute it), with a function > called tomcat5_manager(). This function does 2 things - ensure a > package exists, ensure 2 files exist. > > However, when I attempt to control two separate instances of tomcat > (call them imaginatively A and B), Puppet throws an error of: > err: Could not retrieve catalog: Puppet::Parser::AST::Resource failed > with error ArgumentError: Duplicate definition: > Package[tomcat5-admin-webapps] is already defined in file > /etc/puppet/modules/tomcat5/manifests/os/centos-5.pp at line 16; > cannot redefine at > /etc/puppet/modules/tomcat5/manifests/os/centos-5.pp:16 on node > lhm-srv-app01.impello.co.uk. > > This makes sense, there are two calls to that package. However, I > need a way to ensure that package is install as part of the module, > but only when that define is used - I don''t want it installed > normally. > > Ideas on how I can achieve this goal?if the package is always the same (and it looks like that) simply include a class in the define, in which the package is defined. greets pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2008/7/18 Felix Schäfer <schaefer@cypres-it.com>:> > Am 18.07.2008 um 12:19 schrieb Duncan Hill: > >> This makes sense, there are two calls to that package. However, I >> need a way to ensure that package is install as part of the module, >> but only when that define is used - I don''t want it installed >> normally. >> >> Ideas on how I can achieve this goal? > > Sounds like something that would benefit from being a virtual resource http://reductivelabs.com/trac/puppet/wiki/VirtualResourcesYou know, I have a ton of virtual users, but virtual packages never came to mind. That works (well, the manifest compiles), so thank you :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---