On Monday, November 5, 2012 2:06:09 PM UTC-6, Jist Anidiot wrote:
>
> So I thought puppet didn't care about the order of things unless
> specifically told. However I've come across one case where it apparently
> does care.
>
You had a serious misunderstanding. Puppet has numerous sensitivities to
the order in which it parses declarations in your manifests. You were
probably thinking about how Puppet does not promise to apply resources in
any particular order unless you tell it otherwise by declaring
relationships, but there it's *you* who may not care, not Puppet.
>
> This "works" as expected:
>
> node /^univ\d+\.foo\.edu$/ {
>
> $myvar = "foo"
>
> include module_that_uses_myvar
>
> }
>
>
> This one doesn't "work" as expected
>
>
> node /^univ\d+\.foo\.edu$/ {
>
> include module_that_uses_myvar
>
> $myvar = "foo"
>
> }
>
> In the 2nd one, module_that_uses_myvar seems to think $myvar is undef or
> null or something that is most certainly not "foo" If it matters any,
> $myvar is actually used in an erb template that the module has. Our puppet
> master is 2.7.12 and the client is 2.6.17.
>
> I didn't see any bug reports about this. Is this a known problem or just
> not considered a bug?
>
It is not considered a bug. It is the manifest author's responsibility to
ensure that any reference to a class, resource, or variable is preceded by
a declaration of that entity in Puppet's parse order.
Use of dynamically-scoped variables is considered poor practice, however,
including any use of node-scoped variables outside their node blocks. Your
v. 2.7 master ought to be emitting warnings about that.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/28RuMye2nc8J.
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.