On 23.08.2012, at 07:59, Douglas Garstang wrote:

...

>> Normally this works:
>> 
>> define task_one ( $user = 'root' ) {
>>    file { '/tmp/one':
>>      owner => $user,
>>      content => $user,
>>   }
>> }
>> define task_two ( $user = 'root' ) {
>>   file { '/tmp/two':
>>      owner => $user,
>>      content => $user,
>>   }
>> }
>> task_one { 'foo': }
>> task_two { 'foo': }
>> Task_one['foo'] -> Task_two['foo']
>> 
>> You can also place the order inside the define:
>> 
>> define task_two ( $user = 'root') {
>>   file { '/tmp/two':
>>      owner => $name,
>>      content => $name,
>>   }
>>   Task_one["$name"] -> Task_two["$name"]
>> }
> 
> This really irks me. Is this documented anywhere? How did Task_one get
> into scope inside Task_two? What is the scope for definitions? Are
> they global?

My testcase run in a single manifest. So all defines are within the same scope.
In case that you use modules you need to give the full scope on ordering.

e.g.

Modue_one::Task_one['foo'] -> Module_two::Task_two['foo']


-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to