On 08/24/2011 11:54 AM, Jonathan Gazeley wrote:
> Hi,
> 
> Sorry if this is a basic question, but I can't find the answer in the
> docs. I know about fully-qualified variables, but how can I reference a
> type that is defined in a different class, so I can require/subscribe it?
> 
> In this simple example, what's the right syntax for making goodbye.txt
> require hello.txt?
> 
> class class1 {
>   file { "hello.txt" }
> }
> 
> class class2 {
>   file { "goodbye.txt":
>     require => File['hello.txt'],
>   }
> }
> 
> 
> Thanks,
> Jonathan
> 

class class1 {
   file { hello:
     path => 'hello.txt',
   }
}

class class2 {
   file { goodbye:
     path => 'goodbye.txt',
     require => File[class1::hello],
   }
}

(untested!)

-- 
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.

Reply via email to