As I understand the proper use of "environments", you would have a separate 
definition of the class for QA.

>From puppet,conf:

[main]
    certname = 'puppetmaster.example.com'
     
    # The Puppet log directory.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    ssldir = $vardir/ssl

    # sync custom facts and plugins
    # pluginsync = true
[master]
    modulepath = $confdir/environments/$environment/modules:$confdir/modules
    manifest = $confdir/manifests/unknown_environment.pp

[production]
    modulepath = $confdir/environments/production/modules:$confdir/modules
    manifest = $confdir/manifests/site.pp

[qa]
    modulepath = $confdir/environments/qa/modules:$confdir/modules
    manifest = $confdir/manifests/site.pp

[dev]
    modulepath = $confdir/environments/dev/modules:$confdir/modules
    manifest = $confdir/manifests/site.pp

[agent]
    #  This allows the puppetmaster to have a client running on the same 
machine.
    server='puppetmaster.example.com'
    certname = 'pmclient.example.com'
    # environment is production by default, but I want it explicitly set
    environment = production


How about breaking the class into pieces ?  That way, if ony one piece needs to 
be customized for QA, it can still utilize the other, common parts. 

class app-server:config
class app-server:backend
...

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

----- Guy Matz <gm...@matz.org> wrote:
> Hello, Everybody!
> 
> I need to allow my developers to run a special script on QA servers and
> nowhere else.   I put this sort of thing in place:
> class app-server {
>   packages: foo:; bar:; baz:;
> 
>   if $environment == 'qa' {
>     file {
>        'a':
>         content => ...
>   }
> }
> 
> which feels kinda kludgey to me.  Is there a better way to handle unique
> cases like this in puppet?
> 
> Thanks, Everybody!
> Guy
> 
> -- 
> 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.
> 

-- 
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.

Reply via email to