On Jun 30, 2010, at 8:33 AM, R.I.Pienaar wrote:

> hey
> 
> ----- "Patrick Mohr" <kc7...@gmail.com> wrote:
> 
>> On Jun 30, 2010, at 3:09 AM, R.I.Pienaar wrote:
>> 
>>> 
>>> ----- "Trevor Vaughan" <tvaug...@onyxpoint.com> 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")
>>      }
>> }
> 
> 
> This would fall under the umbrella of bad manifest design :) I'd expect it to 
> print different alerts between runs - today it would be predictable, i think 
> but I wouldnt treat that as something to rely on.

I agree it's bad design and I'm not using that code, but I think you need to 
know how puppet should treat this case before the problem can be fixed.

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

Reply via email to