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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Scott, Multiple environments is working for me under puppet 0.25.1. I''m not sure what''s wrong, but I wonder if having a manifest and modulepath entry in the [main] part of your puppet.conf is overriding any sections below. My puppet.conf does not have a manifest or modulepath entry in [main]. Pete On Wed, Nov 11, 2009 at 9:53 PM, Scott <scott.br@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Pete, I only put the "modulepath" and "manifest" entries in the "main" section in an attempt to get environments to work. So your configuration is working with just a separate section like [testing] in my puppet.conf? No "environments" entry in [puppetmasterd] and just "modulepath" and "manifest" entries? Or anything else I might have missed? Scott On Nov 13, 2:22 am, Pete Emerson <pemer...@gmail.com> wrote:> Scott, > > Multiple environments is working for me under puppet 0.25.1. > > I''m not sure what''s wrong, but I wonder if having a manifest and > modulepath entry in the [main] part of your puppet.conf is overriding > any sections below. My puppet.conf does not have a manifest or > modulepath entry in [main]. > > Pete > > On Wed, Nov 11, 2009 at 9:53 PM, 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Scott wrote:> Is anyone using multiple environments? Can someone at least tell me > what they did to get it working?I do. My puppet.conf on the master looks like this: --- puppetmaster:/etc/puppet/puppet.conf ------------------------------- [main] vardir = /var/lib/puppet logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl [puppetd] vardir=/var/lib/puppet logdir=/var/log/puppet rundir=/var/run/puppet ssldir=$vardir/ssl color=false server=jolokia.nsc.liu.se pluginsync=true report=true runinterval=14400 splay=true splaylimit=305 usecacheonfailure=false classfile = $vardir/classes.txt localconfig = $vardir/localconfig [puppetmasterd] manifestdir=/dev/null manifest=/dev/null/site.pp libdir=/config/e/production/modules/nsc-puppet-utils/plugins vardir=/var/lib/puppet logdir=/var/log/puppet rundir=/var/run/puppet ssldir=$vardir/ssl [production] manifestdir=/config/e/production/manifests manifest=/config/e/production/manifests/site.pp modulepath=/config/e/production/modules [bellman] manifestdir=/config/e/bellman/manifests manifest=/config/e/bellman/manifests/site.pp modulepath=/config/e/bellman/modules ------------------------------------------------------------------------ On the clients, I run puppetd from cron like this: /usr/sbin/puppetd --onetime --no-splay --color=false \ --logdest=console --no-usecacheonfailure \ --no-daemonize --pluginsync --report \ --server="$server" --environment="$environ" Replace $server and $environment with the name of your puppetmaster and the environment you want to use. (And I actually redirect the output to a local logfile, named according to date and time.) You should be able to put those parameters in puppet.conf on the client instead of passing them on the command line. If you have any custom types or custom functions, you *can''t* have them per environment. You will note that the libdir parameter in my master''s puppet.conf is in the [puppetmasterd] section, not in the [production] or [bellman] sections. :-( Luckily I don''t update my plugins very often, so I survive, but it''s not exactly fun. (In 0.24 you can''t even have custom facts per environment, but at least that was fixed for 0.25.) /Bellman --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hello, ----- "Thomas Bellman" <bellman@nsc.liu.se> wrote:> Scott wrote: > > > Is anyone using multiple environments? Can someone at least tell > me > > what they did to get it working? >I wrote up the following: http://www.devco.net/archives/2009/10/10/puppet_environments.php That''ll work for 0.24.8 onward, before then you needed to set environments=<all your environments> but thats not needed anymore -- R.I.Pienaar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---