I just had to set the environment variable in the puppet.conf file before starting the puppetd daemon. Then in each class I use that variable to determine what happens, for example
file { "smtpd.conf": owner => root, group => root, mode => 600, source => $environment ? { preproduction => "puppet:///....", test => "....", production => "....", }, } or in other classes, I have if/else blocks based on the $environment variable. I am in the 0.24.8 version that EPEL has though, not 0.25.x Luke On Nov 12, 2009, at 19:30 EST, Scott wrote: > > Is anyone using multiple environments? Can someone at least tell me > what they did to get it working? > > Thanks, > Scott > > On Nov 12, 6:53 am, Scott <scott...@gmail.com> wrote: >> So I'm trying to get multiple environments to work with puppet 0.25.1 >> on ubuntu 8.04 and no matter what I do, puppet just completely ignores >> any environment setting. There's really next to no information in >> terms of configuration on the multiple environments documentation page >> (http://reductivelabs.com/trac/puppet/wiki/UsingMultipleEnvironments) >> other than saying that the following section should be in my >> puppet.conf file: >> >> [main] >> manifest = /usr/share/puppet/site.pp >> modulepath = /usr/share/puppet/modules >> >> [development] >> manifest = /usr/share/puppet/development/site.pp >> modulepath = /usr/share/puppet/development/modules >> >> There are other references on web pages and groups to an >> "environments" setting under "puppetmasterd" as well as having a >> default "environment" setting in "main" for the clients but I've tried >> all of that and nothing works. There's also no reference at all to >> any environment in debugging mode when I run "puppetd --test -- >> environment=test -d". Am I missing something? >> >> Here's a copy of my puppet.conf file: >> >> [main] >> vardir = /var/lib/puppet >> manifest = /etc/puppet/manifests/site.pp >> modulepath = /etc/puppet/modules >> pluginsync = true >> storeconfigs = true >> # >> dbadapter = mysql >> dbuser = puppet >> dbpassword = **** >> dbserver = mysql.example.com >> >> [puppetmasterd] >> certname=puppet.example.com >> >> [testing] >> manifest=/etc/puppet-testing/manifests/site.pp >> modulepath=/etc/puppet-testing/modules >> >> [production] >> manifest=/etc/puppet/manifests/site.pp >> modulepath=/etc/puppet/modules >> >> Cheers, >> Scott > > --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---