On Mar 7, 2:37 am, Pablo Fernandez <pablo.fernan...@cscs.ch> wrote:
> > On the other hand, I think your expectations are incorrect.  It is
> > "enclosed" objects that are documented to also get tagged, and I would
> > not consider a node definition to be "enclosed by" another that
> > inherits from it.
>
> So, is there no "scope" when we talk about tags? Because I have noticed that,
> in more complex scenarios, tags are actually passed around (at this point I
> don't know if I should call this inherited, enclosed, or what), like this:
>
> node 'ANY' {
>   include ssh::server  # Default sshd_config
>
> }
>
> node 'WN' inherits 'ANY' {
>   include ssh::enable_hostbased_auth
>
> }
>
> node 'ppwn01.lcg.cscs.ch' inherits 'WN' {
>
> }
>
> I print this within the ssh::enable_hostbased_auth context:
> TAGS: class ssh::enable_hostbased_auth ssh enable_hostbased_auth node wn
>
> So, I get both the tags WN and ssh::enable_hostbased_auth, it means it picked
> up the tags from the node, and from the class... but I don't get the
> ssh::server, that's comming from the parent of WN.


I wouldn't say there's no scoping involved, but I don't follow how you
envision involvement of scope leading to a different result than you
see.  I suspect you have the wrong mental model for node inheritance,
and I speculate that the word "enclose" may have been chosen
specifically to avoid implying the behavior you seem to have been
expecting.

Here's what I think tag "inheritance" actually involves:
1) there is a tag associated with each node definition block
2) every class and resource declared directly within a node definition
block acquires the containing block's tag
3) there is a tag associated with each class
4) every class and resource declared directly within a[nother] class
acquires all the tags on the declaring class, plus the tag associated
with the containing class
5) neither node inheritance nor class inheritance factors into the
analysis


> What I need is a reliable way to do node groups, where I can specify some
> configuration parameters per group and per node, and the modules should be
> aware of that. Tags don't seem apropiate, and possible neither variables (they
> difer within all scopes, and from the modules I can't reference variables
> created on the nodes). What's the right way to do this, then?


No, tags are not the right tool for that kind of job.  What you
describe is exactly the sort of thing that Hiera is good for,
however.  Or extlookup() might do the job, too, but at this point it's
much more forward-looking to go with Hiera.


John

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