On Thu, Jul 29, 2010 at 12:58 PM, Nigel Kersten <[email protected]> wrote:

> > How do you "know" what the scope is of those included classes will end
> > up as?  Are you not including the "edge" classes multiple times?
>
> Nope. That would be insane due to what sparked this thread off :)


I think this is something that is really becoming an issue with the
increasing number of modules published to the Forge.  Modules need some way
to satisfy their dependencies on other modules, and the current behavior of
include just doesn't seem to cut it.

What about include ::localyumrepository ?

It's valid syntax in 0.24.9, 0.25.5, and 2.6.0

And...  Believe it or not, it actually already does almost exactly what I
want it to do in 2.6, except I think I found a bug in 2.6.

Here's my test manifest:
#
class leaf { notify { "leaf": } }
class baseone {
  Notify { message => "baseone" }
  notify { "baseone": }
  include ::leaf
}
class basetwo {
  Notify { message => "basetwo" }
  notify { "basetwo": }
  include ::leaf
}
include baseone, basetwo
# include basetwo, baseone

Here's the result in 0.25.5 and 0.24.9:
notice: baseone
notice: //baseone/Notify[baseone]/message: defined 'message' as 'baseone'
notice: baseone
notice: //baseone/leaf/Notify[leaf]/message: defined 'message' as 'baseone'
notice: basetwo
notice: //basetwo/Notify[basetwo]/message: defined 'message' as 'basetwo'

Notice how Notify[leaf]'s scope is within baseone, which was the first class
to include it.

Now, for the pleasant surprise: (in 2.6.0)
notice: basetwo
notice: /Stage[main]/Basetwo/Notify[basetwo]/message: defined 'message' as
'basetwo'
notice: baseone
notice: /Stage[main]/Leaf/Notify[leaf]/message: defined 'message' as
'baseone'
notice: baseone
notice: /Stage[main]/Baseone/Notify[baseone]/message: defined 'message' as
'baseone'

It *appears* Notify[leaf] is not within the scope of Baseone or Basetwo,
however it's still getting the default value of the message parameter from
the baseone class...  Flipping in the order around to include basetwo,
baseone we get:
notice: /Stage[main]/Leaf/Notify[leaf]/message: defined 'message' as
'basetwo'

Again, it looks like the class is included into top scope, but the behavior
is that we're still getting resource defaults from basetwo's scope.

Thoughts?  Am I insane for wanting include ::leaf to place Leaf at top
scope?

-- 
Jeff McCune
http://www.puppetlabs.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to