Hi All I''m gradually migrating our Puppet infrastructure to a module based one, and while working on that I rely heavily on the environments. The page about modules (http://reductivelabs.com/trac/puppet/wiki/ModuleOrganisation ) states that from version 0.23.1 Puppet autoloads modules, but I can''t get that to work, even though I use version 0.24.4. When I started to use modules, I didn''t use environments, and I imported my modules at the top level (in a file imported into site.pp). When I introduced environments a new annoyance popped up: I had to have all modules in both the modules dir and the modules-dev dir, or else Puppet barked at me. I''ve now used a case statement to only include modules in development, when running in development and that made Puppet shut up. My question is: Does module autoload work and if so, what do I do wrong, since it doesn''t work for me? And how do you cope with modules and environments...? -- Med venlig hilsen/Best regards Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: +45 70 202 407 www.fab-it.dk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > When I started to use modules, I didn''t use environments, and I > imported my modules at the top level (in a file imported into > site.pp). When I introduced environments a new annoyance popped up: I > had to have all modules in both the modules dir and the modules-dev > dir, or else Puppet barked at me. I''ve now used a case statement to > only include modules in development, when running in development and > that made Puppet shut up.This is not setup right, if you are having this problem.> > My question is: Does module autoload work and if so, what do I do > wrong, since it doesn''t work for me? And how do you cope with modules > and environments...?Autoloading works fine if you follow the rules and it plays nice with environments if you have it setup right. What is your puupet.conf for clients and puppetmaster? what is the directory setup you have? Whatare teh module names and the class names? Evan --~--~---------~--~----~------------~-------~--~----~ 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 Evan On Sep 3, 2008, at 16:30 , Evan Hisey wrote:>> When I started to use modules, I didn''t use environments, and I >> imported my modules at the top level (in a file imported into >> site.pp). When I introduced environments a new annoyance popped up: I >> had to have all modules in both the modules dir and the modules-dev >> dir, or else Puppet barked at me. I''ve now used a case statement to >> only include modules in development, when running in development and >> that made Puppet shut up. > This is not setup right, if you are having this problem. > >> >> My question is: Does module autoload work and if so, what do I do >> wrong, since it doesn''t work for me? And how do you cope with modules >> and environments...? > Autoloading works fine if you follow the rules and it plays nice with > environments if you have it setup right. What is your puupet.conf for > clients and puppetmaster? what is the directory setup you have? > Whatare teh module names and the class names?In puppet.conf on both clients and server I have: [main] confdir = /etc/puppet environment = production (or development for my dev nodes) On the puppetmaster: [puppetmasterd] environments = development,testing,production,bootstrap [development] modulepath = $confdir/modules-dev [production] modulepath = $confdir/modules [testing] modulepath = $confdir/modules-testing In site.pp I import modules.pp which in turn imports the individual modules: modules.pp: import "common" import "apache" import "installmethods" import "postfix" case $environment { "development": { import "apt-cacher" import "xen" } } I''ve tried to remove the individual imports, but then puppetmaster just complains about not beeing able to find the modules at all. I''ve added the case statement to only import modules in dev environment when they are in development. Without the statement, puppet want''s the module to be present in both environments. The apt-cacher module is structured this way: apt-cacher |--- manifests | |--- init.pp | |--- templates |--- apt-cacher.conf.erb The init.pp file holds a class called apt-cacher. I hope you can shed some light on what is wrong - I can''t see the cause of the problem... -- Med venlig hilsen/Best regards Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: +45 70 202 407 www.fab-it.dk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>>> >>> My question is: Does module autoload work and if so, what do I do >>> wrong, since it doesn''t work for me? And how do you cope with modules >>> and environments...? >> Autoloading works fine if you follow the rules and it plays nice with >> environments if you have it setup right. What is your puupet.conf for >> clients and puppetmaster? what is the directory setup you have? >> Whatare teh module names and the class names? > > In puppet.conf on both clients and server I have: > > [main] > confdir = /etc/puppet > environment = production (or development for my dev nodes) > > On the puppetmaster: > [puppetmasterd] > environments = development,testing,production,bootstrapThis looks good.> > [development] > modulepath = $confdir/modules-dev > > [production] > modulepath = $confdir/modules > [testing] > modulepath = $confdir/modules-testingHere try changing the $confdir to the actual path for each modules directory. There was an issue in puppet 2.24.4 with variables in the config file and the environments.> > In site.pp I import modules.pp which in turn imports the individual > modules: > > modules.pp: > import "common" > import "apache" > import "installmethods" > import "postfix" > > case $environment { > "development": { > import "apt-cacher" > import "xen" > } > }This case statement needs to go away. It is bypassing the whole point of using environments.> I''ve tried to remove the individual imports, but then puppetmaster > just complains about not beeing able to find the modules at all. > > I''ve added the case statement to only import modules in dev > environment when they are in development. Without the statement, > puppet want''s the module to be present in both environments.It is having probelms becuase it is having problems finding the environment modules paths.> The apt-cacher module is structured this way: > > apt-cacher > |--- manifests > | |--- init.pp > | > |--- templates > |--- apt-cacher.conf.erb > > The init.pp file holds a class called apt-cacher.That looks correct. I assume the Xen module is set up the same way. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 4, 2008, at 16:51 , Evan Hisey wrote:>> [testing] >> modulepath = $confdir/modules-testing > Here try changing the $confdir to the actual path for each modules > directory. There was an issue in puppet 2.24.4 with variables in the > config file and the environments.I''ve tried that, plus removing the case statement that explicitly imports modules based on environment, with no luck - it still wants all modules to be present in all environments in use (that is only development and production for now). I''ve also tried to remove the import of modules.pp in site.pp, and then puppet gets totally confused...>> In site.pp I import modules.pp which in turn imports the individual >> modules: >> >> modules.pp: >> import "common" >> import "apache" >> import "installmethods" >> import "postfix" >> >> case $environment { >> "development": { >> import "apt-cacher" >> import "xen" >> } >> } > This case statement needs to go away. It is bypassing the whole point > of using environments.I''ve tried to remove it, with no luck unfortunately :-(>> The apt-cacher module is structured this way: >> >> apt-cacher >> |--- manifests >> | |--- init.pp >> | >> |--- templates >> |--- apt-cacher.conf.erb >> >> The init.pp file holds a class called apt-cacher. > > That looks correct. I assume the Xen module is set up the same way.Yes, they are more or less structured the same way - some are more complex than the module shown above... -- Med venlig hilsen/Best regards Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: +45 70 202 407 www.fab-it.dk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---