I know that you can qualify variable names from inside a class. How about qualifying a variable inside a nested class: class module::class_a { class module::class_a::class_b { $variable = "test" } } notice $module::class_a::class_b::variable Are classes and variables the only things you can qualify? What about defines? Thanks. -eric -- 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.
----- "Eric Snow" <esnow@verio.net> wrote:> I know that you can qualify variable names from inside a class. How > about qualifying a variable inside a nested class: > > class module::class_a { > class module::class_a::class_b { > $variable = "test" > } > } > notice $module::class_a::class_b::variableyou''ve created $module::module::class..... you really should just put classes each in their own files it makes it all more obvious. same applies to defines -- 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.
Thanks for the response. I''m afraid I don''t see the relationship between resolving the qualified variable and moving classes into their own manifests. Even if class_a were in its own manifest I would have the same problem. I appreciate your help. I expect that I have misunderstood. Thanks. -eric On Nov 11, 4:40 pm, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > I know that you can qualify variable names from inside a class. How > > about qualifying a variable inside a nested class: > > > class module::class_a { > > class module::class_a::class_b { > > $variable = "test" > > } > > } > > notice $module::class_a::class_b::variable > > you''ve created $module::module::class..... > > you really should just put classes each in their own files it makes > it all more obvious. > > same applies to defines-- 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.
----- "Eric Snow" <esnow@verio.net> wrote:> Thanks for the response. I''m afraid I don''t see the relationship > between resolving the qualified variable and moving classes into > their > own manifests. Even if class_a were in its own manifest I would have > the same problem. > > I appreciate your help. I expect that I have misunderstood. Thanks.you would not, class module::class_a { } and in another file class module::class_a::class_b { } that''s what you would have and that would create the module layout you''d expect its just harder to make the mistake you made which is: class a { class b { } } this creates classes a and a::b now look at your naming. Nesting them also messes around the autloader.> > -eric > > On Nov 11, 4:40 pm, "R.I.Pienaar" <r...@devco.net> wrote: > > ----- "Eric Snow" <es...@verio.net> wrote: > > > > > I know that you can qualify variable names from inside a class. > How > > > about qualifying a variable inside a nested class: > > > > > class module::class_a { > > > class module::class_a::class_b { > > > $variable = "test" > > > } > > > } > > > notice $module::class_a::class_b::variable > > > > you''ve created $module::module::class..... > > > > you really should just put classes each in their own files it makes > > it all more obvious. > > > > same applies to defines > > -- > 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.-- R.I.Pienaar -- 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.
I gotta say that was unexpected. Thanks for the clarification. I am finding that scoping in puppet is pretty unusual. Thanks. -eric On Nov 11, 4:59 pm, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > Thanks for the response. I''m afraid I don''t see the relationship > > between resolving the qualified variable and moving classes into > > their > > own manifests. Even if class_a were in its own manifest I would have > > the same problem. > > > I appreciate your help. I expect that I have misunderstood. Thanks. > > you would not, > > class module::class_a { > > } > > and in another file > > class module::class_a::class_b { > > } > > that''s what you would have and that would create the module layout you''d expect > its just harder to make the mistake you made which is: > > class a { > class b { > } > > } > > this creates classes a and a::b now look at your naming. > > Nesting them also messes around the autloader. > > > > > > > > > > > > > -eric > > > On Nov 11, 4:40 pm, "R.I.Pienaar" <r...@devco.net> wrote: > > > ----- "Eric Snow" <es...@verio.net> wrote: > > > > > I know that you can qualify variable names from inside a class. > > How > > > > about qualifying a variable inside a nested class: > > > > > class module::class_a { > > > > class module::class_a::class_b { > > > > $variable = "test" > > > > } > > > > } > > > > notice $module::class_a::class_b::variable > > > > you''ve created $module::module::class..... > > > > you really should just put classes each in their own files it makes > > > it all more obvious. > > > > same applies to defines > > > -- > > 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. > > -- > R.I.Pienaar-- 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.