Hi,

You setting sudoenv to default in the default node. That is not overridden by 
subsequent node declarations.

If you are using 2.6 and above I would pass a parameter to the sudoers class.

> class sudoers::config (env = 'default') {
>  file { "/etc/sudoers":
>    ensure => file,
>    owner => "root",
>    group => "root",
>    mode => 440,
>    source => "puppet:///modules/sudoers/sudoers_
> ${env}",
>  }


then maybe call like this.

> node 'server-defaults' inherits default {
>  class {"sudoers::config": env => 'custom_server' }
> }

then
> node default {
>  class {"sudoers::config": }
> }


That might help you.

Cheers,
Den
On 05/08/2011, at 17:02, Thomas Rasmussen <rasmussen.tho...@gmail.com> wrote:

> Hi
> 
> I'm having some trouble with the following setup:
> 
> node 'serverA' inherits server-defaults {
>  include myApp::install
> }
> 
> node 'server-defaults' inherits default {
>  $sudoenv = 'custom_server'
> }
> 
> node default {
>  $sudoenv = 'default'
>  include sudoers::config
> }
> 
> class sudoers::config {
>  file { "/etc/sudoers":
>    ensure => file,
>    owner => "root",
>    group => "root",
>    mode => 440,
>    source => "puppet:///modules/sudoers/sudoers_
> $sudoenv",
>  }
> }
> 
> I have then created to files: sudoers_default and
> sudoers_custom_server
> 
> I want to have a default sudoers file on most of my servers, but on a
> few others, I need a different one, but on serverA I only get the
> sudoers_default file. I have tried to create it as a template (still
> using the $sudoenv varialbe) but this does not have any effect. Only
> if I move the include sudoers::config to the 'server-defaults' node,
> then it works as I want.
> 
> Being somewhat new to puppet, I really cant figure out how I can solve
> this task, but hopefully somebody can give some good hints?
> 
> There isn't any of my default variables that I can use instead of
> $sudoenv.
> 
> Hope somebody has hints
> 
> Regards
> Thomas
> 
> -- 
> 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