Mark Dixon
2012-Mar-22 12:54 UTC
[Puppet Users] Including bar::something sometimes gives me foo::bar::something
Hi, I''m a puppet newbie and am seeing something unexpected. If I have a module called "foo", from which I try to call a manifest in a different module, e.g. "bar::something", I get "foo::bar::something" instead (if it exists). Example puppet code showing this is below. Have I missed an important doc explaining this behaviour? I''d like to find out how to explicitly request "bar::something" instead - I tried "::bar::something", but this called *both* of them(!) I''m running 2.7.11. Thanks, Mark -- ----------------------------------------------------------------- Mark Dixon Email : m.c.dixon@leeds.ac.uk HPC/Grid Systems Support Tel (int): 35429 Information Systems Services Tel (ext): +44(0)113 343 5429 University of Leeds, LS2 9JT, UK ----------------------------------------------------------------- # Call a manfest under module foo, which calls "bar::something" class { ''foo::test'': } class foo::test { class { ''bar::something'': } } # Alternative "bar::something" manifests # - This is the one that wins class foo::bar::something { notify { ''poop poop!'': withpath => true } } class bar::something { notify { ''peep peep!'': withpath => true } } -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Luke Bigum
2012-Mar-22 13:03 UTC
Re: [Puppet Users] Including bar::something sometimes gives me foo::bar::something
What do you mean "call a manifest"? That seems strange... Can you post your code and what you are trying to achieve? On 22/03/12 12:54, Mark Dixon wrote:> Hi, > > I''m a puppet newbie and am seeing something unexpected. If I have a > module called "foo", from which I try to call a manifest in a > different module, e.g. "bar::something", I get "foo::bar::something" > instead (if it exists). Example puppet code showing this is below. > > Have I missed an important doc explaining this behaviour? > > I''d like to find out how to explicitly request "bar::something" > instead - I tried "::bar::something", but this called *both* of them(!) > > I''m running 2.7.11. > > Thanks, > > Mark-- Luke Bigum Information Systems Ph: +44 (0) 20 3192 2520 luke.bigum@lmax.com | http://www.lmax.com LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN The information in this e-mail and any attachment is confidential and is intended only for the named recipient(s). The e-mail may not be disclosed or used by any person other than the addressee, nor may it be copied in any way. If you are not a named recipient please notify the sender immediately and delete any copies of this message. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Any view or opinions presented are solely those of the author and do not necessarily represent those of the company. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mark Dixon
2012-Mar-22 15:14 UTC
Re: [Puppet Users] Including bar::something sometimes gives me foo::bar::something
On Thu, 22 Mar 2012, Luke Bigum wrote: ...> Can you post your code and what you are trying to achieve?I did put it at the end of my original message, but here it is again... # Instantiate singleton foo::test, which in turn instantiates # "bar::something" class { ''foo::test'': } class foo::test { class { ''bar::something'': } } # Alternative "bar::something" manifests # - This is the one that wins class foo::bar::something { notify { ''poop poop!'': withpath => true } } # - This is the one I want class bar::something { notify { ''peep peep!'': withpath => true } } Thanks, Mark -- ----------------------------------------------------------------- Mark Dixon Email : m.c.dixon@leeds.ac.uk HPC/Grid Systems Support Tel (int): 35429 Information Systems Services Tel (ext): +44(0)113 343 5429 University of Leeds, LS2 9JT, UK ----------------------------------------------------------------- -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dan White
2012-Mar-22 15:39 UTC
Re: [Puppet Users] Including bar::something sometimes gives me foo::bar::something
Something about this just does not feel right. You can re-use a name -- as in foo::params and bar::params, but I think you would have the same problem if you tried to declare a base-class "params" I cannot find any reference about the <thisName>::<thatName> class naming/syntax. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Mark Dixon <m.c.dixon@leeds.ac.uk> wrote:> Hi, > > I''m a puppet newbie and am seeing something unexpected. If I have a module > called "foo", from which I try to call a manifest in a different module, > e.g. "bar::something", I get "foo::bar::something" instead (if it exists). > Example puppet code showing this is below. > > Have I missed an important doc explaining this behaviour? > > I''d like to find out how to explicitly request "bar::something" instead - > I tried "::bar::something", but this called *both* of them(!) > > I''m running 2.7.11. > > Thanks, > > Mark > -- > ----------------------------------------------------------------- > Mark Dixon Email : m.c.dixon@leeds.ac.uk > HPC/Grid Systems Support Tel (int): 35429 > Information Systems Services Tel (ext): +44(0)113 343 5429 > University of Leeds, LS2 9JT, UK > ----------------------------------------------------------------- > > # Call a manfest under module foo, which calls "bar::something" > class { ''foo::test'': } > > class foo::test { > class { ''bar::something'': } > } > > > # Alternative "bar::something" manifests > > # - This is the one that wins > class foo::bar::something { > notify { ''poop poop!'': withpath => true } > } > > class bar::something { > notify { ''peep peep!'': withpath => true } > } > > -- > 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+unsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mark Dixon
2012-Mar-22 16:12 UTC
Re: [Puppet Users] Including bar::something sometimes gives me foo::bar::something
On Thu, 22 Mar 2012, Dan White wrote:> Something about this just does not feel right.Do you mean I''ve misunderstood things, or that it looks like something crazy is going on?> You can re-use a name -- as in foo::params and bar::params, but I think > you would have the same problem if you tried to declare a base-class > "params" > > I cannot find any reference about the <thisName>::<thatName> class > naming/syntax.... Glad I''ve not missed reading an obvious document :) It gets even crazier if you try including "::bar::something" (I thought "::" might act as a root character) - both manifests with similar names are instantiated: class { ''foo::test'': } class foo::test { class { ''::bar::something'': } } class foo::bar::something { notify { ''poop poop!'': withpath => true } } class bar::something { notify { ''peep peep!'': withpath => true } } Produces (2.7.11): $ puppet apply test.pp notice: /Stage[main]/Bar::Something/Notify[peep peep!]/message: peep peep! notice: /Stage[main]/Bar::Something/Notify[peep peep!]/message: defined ''message'' as ''peep peep!'' notice: /Stage[main]/Foo::Bar::Something/Notify[poop poop!]/message: poop poop! notice: /Stage[main]/Foo::Bar::Something/Notify[poop poop!]/message: defined ''message'' as ''poop poop!'' notice: Finished catalog run in 0.04 seconds I''m baffled. If anyone has any ideas, I''d really appreciated it. Thanks, Mark -- ----------------------------------------------------------------- Mark Dixon Email : m.c.dixon@leeds.ac.uk HPC/Grid Systems Support Tel (int): 35429 Information Systems Services Tel (ext): +44(0)113 343 5429 University of Leeds, LS2 9JT, UK ----------------------------------------------------------------- -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.