I have following problem: defined class ldap-client, which install and configure ldap on _all_ nodes. there is file[/etc/nsswitch.conf]. it add 'ldap' to nsswitch.conf defined class winbind, which install and configure winbind on _some_ nodes. and it need also to change nsswitch.conf, adding 'winbind' there.
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? btw, my solution don't work. tagged(winbind) in ldap-client return always false, but winbind class runs ok. On 15 окт, 13:40, Bruce Richardson <itsbr...@workshy.org> wrote: > On Fri, Oct 15, 2010 at 01:04:29AM -0700, luke.bigum wrote: > > Someone correct me if I am wrong, but defined() is useful for checking > > if types or classes exist ("are known about") but does not check > > whether a class is DECLARED - there's a difference. Note the > > documentation sentence "This is useful for checking whether a class is > > defined and only including it if it is". > > You're not wrong. That said, I'd actually advice the OP against trying > this kind of thing. Generally, I find specific class dependencies are > something to avoid. The only place I tolerate them is in "role" > classes, which is where I usually set up any dependencies between > modules that are required, and there I don't need to use defined() or > tagged() to check them, because I know precisely which classes have been > included. > > Every time you add a dependency to a specific class, you cause problems > for the person who finds a need to creat a new class that inherits from > it. That person will often be you and kicking yourself is not > rewarding. Looking at my manifests and modules, the *only* places I > have a dependency on a named class is in my site::role classes and in > the samba::packages class where the named classes are internal to the > samba module and contain collections of packages (and their > dependencies) relevant to specific versions of Samba. > > -- > Bruce > > Explota!: miles de lemmings no pueden estar equivocados. -- 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.