On 10/15/2010 05:40 PM, Bruce Richardson wrote:
> On Fri, Oct 15, 2010 at 07:06:52AM -0700, walexey wrote:
>> i can't imaging something better than add
>>
>>        if tagged(winbind) {
>>                 $winbind = 'winbind'
>>         } else {
>>                 $winbind = ''
>>         }
>> in ldap-client class
>>
>> and add
>> passwd:     files <%= winbind %> ldap
>> to nsswithch.conf template.
>>
>> can you show me the right way?
>>
> 
> There is more than one way to do this.

So true... ;-)

If there are only those two flavors of nsswitch.conf files in your
network (or very few more), you might put it in a class of its own:

class nsswitch_conf { file { "/etc/nsswitch.conf": content => "..." } }

Then add the proper passwd line in a subclass:

class nsswitch_conf_winbind inherits nsswitch_conf {
  File["/etc/nsswitch.conf"] {
    content => "...\npasswd: files windbind ldap\n..."
  }
}

This approach is limited, but you could as well use your template in the
nsswitch_conf class and set different variables in the subclass.
(Remember to still use the override as sketched above, simply setting
variables will do no good in a subclass). That still saves you from the
scoping and order fuss.

Each of your nodes will include nsswitch_conf per default, an in your
ldap client class, you will additionally include nsswitch_conf_winbind.

Regards,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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