On Jun 30, 2010, at 3:09 AM, R.I.Pienaar wrote:
>
> ----- "Trevor Vaughan" <[email protected]> wrote:
>
>> Also, I'm not entirely convinced that variables can't be overridden.
>> I understand that the final compilation is order independent, but I
>> believe that the initial run is file order dependent. I.e. if you
>> don't declare an 'include' before an 'if' statement checking for the
>> included class, then you end up with an 'if' that is not called. Could the
>> variable parsing be moved to this layer?
>
> I'd call this parsing behavior a bug, see my comment about defined(), it's
> related to that
>
> http://projects.reductivelabs.com/issues/3049
By the way, ignoring the technical aspect, how do you think defined should work
in this case? In this case, what aleart should be printed, or what error should
be printed? This is a rather contrived example, but I'm not really sure what
puppet should actually do here with your suggestion. (Please excuse my syntax
errors).
node 'test-node' {
include classA
include classB
}
class classA {
if !defined Package['apache']
{
package { 'apache':
ensure => installed,
}
alert("Package apache included by classA")
}
}
class classB {
if !defined Package['apache']
{
package { 'apache':
ensure => installed,
}
alert("Package apache included by classB")
}
}
--
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.