i''m trying to write a couple of modules to install generic python & ruby apps. how do you handle dependencies that are present in two modules, i.e. a package dependency, without causing an already defined error. lets say: module django: class django { package { "build-essential'': ensure => present, } .... .... } module ruby_on_rails: class ruby { package { "build-essential'': ensure => present, } .... .... } if i define this like this, I get an already defined error. I know I can fix this by defining a third class and import it from the others, but you can only do that with the modules you "control". So how do you define package dependencies in a module in a "encapsulated" and reusable way. it seems that its common to include 3rd party puppet modules by linking them via git submodules or by placing them under the module folders, but if i have to fork every 3rd party module that causes the error it seems that i am doing something wrong. -- 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, You might like to have a base packages module that contains a ''build-essentials'' class (or whatever title you like). Then include it and reference the package in your ruby/python modules. include ''basepackages::build-essentials'' ... require => Package[''build-essentials''] ... That help? Den On 08/08/2011, at 2:21, ashwoods <ashwoods@gmail.com> wrote:> i''m trying to write a couple of modules to install generic python & > ruby apps. > how do you handle dependencies that are present in two modules, i.e. a > package dependency, > without causing an already defined error. > > lets say: > > module django: > > class django { > package { "build-essential'': > ensure => present, > } > .... > .... > } > > module ruby_on_rails: > class ruby { > package { "build-essential'': > ensure => present, > } > .... > .... > } > > if i define this like this, I get an already defined error. I know I > can fix this by defining a third class and import it from the others, > but you can only do that with the modules you "control". > > So how do you define package dependencies in a module in a > "encapsulated" and reusable way. > it seems that its common to include 3rd party puppet modules by > linking them via git submodules or by placing them under the module > folders, but if i have to fork every 3rd party module that causes the > error it seems that i am doing something wrong. > > > -- > 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. >-- 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.
No, not really. Because that would require me to modify the 3rd party modules to use that base packages module instead of how its defined. i.e. if i need build-essentials for my django module, put it on github, anybody who uses my module and maybe have another module of their own that also defines build- essentials, forces them to fork libraries. I am still very new to puppet, so maybe im missing somewhat obvious. On 7 Aug., 23:48, Denmat <tu2bg...@gmail.com> wrote:> Hi, > > You might like to have a base packages module that contains a ''build-essentials'' class (or whatever title you like). > > Then include it and reference the package in your ruby/python modules. > > include ''basepackages::build-essentials'' > > ... > require => Package[''build-essentials''] > ... > > That help? > > Den > > On 08/08/2011, at 2:21, ashwoods <ashwo...@gmail.com> wrote: > > > > > > > > > i''m trying to write a couple of modules to install generic python & > > ruby apps. > > how do you handle dependencies that are present in two modules, i.e. a > > package dependency, > > without causing an already defined error. > > > lets say: > > > module django: > > > class django { > > package { "build-essential'': > > ensure => present, > > } > > .... > > .... > > } > > > module ruby_on_rails: > > class ruby { > > package { "build-essential'': > > ensure => present, > > } > > .... > > .... > > } > > > if i define this like this, I get an already defined error. I know I > > can fix this by defining a third class and import it from the others, > > but you can only do that with the modules you "control". > > > So how do you define package dependencies in a module in a > > "encapsulated" and reusable way. > > it seems that its common to include 3rd party puppet modules by > > linking them via git submodules or by placing them under the module > > folders, but if i have to fork every 3rd party module that causes the > > error it seems that i am doing something wrong. > > > -- > > 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 athttp://groups.google.com/group/puppet-users?hl=en.-- 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.
Virtual resources. On Sun, Aug 7, 2011 at 4:51 PM, ashwoods <ashwoods@gmail.com> wrote:> No, not really. Because that would require me to modify the 3rd party > modules to use that base packages module > instead of how its defined. i.e. if i need build-essentials for my > django module, put it on github, anybody who uses my module > and maybe have another module of their own that also defines build- > essentials, forces them to fork libraries. > > I am still very new to puppet, so maybe im missing somewhat obvious. > > On 7 Aug., 23:48, Denmat <tu2bg...@gmail.com> wrote: > > Hi, > > > > You might like to have a base packages module that contains a > ''build-essentials'' class (or whatever title you like). > > > > Then include it and reference the package in your ruby/python modules. > > > > include ''basepackages::build-essentials'' > > > > ... > > require => Package[''build-essentials''] > > ... > > > > That help? > > > > Den > > > > On 08/08/2011, at 2:21, ashwoods <ashwo...@gmail.com> wrote: > > > > > > > > > > > > > > > > > i''m trying to write a couple of modules to install generic python & > > > ruby apps. > > > how do you handle dependencies that are present in two modules, i.e. a > > > package dependency, > > > without causing an already defined error. > > > > > lets say: > > > > > module django: > > > > > class django { > > > package { "build-essential'': > > > ensure => present, > > > } > > > .... > > > .... > > > } > > > > > module ruby_on_rails: > > > class ruby { > > > package { "build-essential'': > > > ensure => present, > > > } > > > .... > > > .... > > > } > > > > > if i define this like this, I get an already defined error. I know I > > > can fix this by defining a third class and import it from the others, > > > but you can only do that with the modules you "control". > > > > > So how do you define package dependencies in a module in a > > > "encapsulated" and reusable way. > > > it seems that its common to include 3rd party puppet modules by > > > linking them via git submodules or by placing them under the module > > > folders, but if i have to fork every 3rd party module that causes the > > > error it seems that i am doing something wrong. > > > > > -- > > > 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 athttp:// > groups.google.com/group/puppet-users?hl=en. > > -- > 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. > >-- 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.