On Fri, Sep 14, 2012 at 03:49:56PM +0200, Jakov Sosic
wrote:> Hi.
> 
> I have 3 custom types, for example A, B, and C.
> 
> A and B are build blocks for C. So if there is no A or B, C will fail to
> be added. For example:
> 
> 
> typeA { ''A'':
>  ...
>  ...
> }
> 
> 
> typeB { ''B'':
>  ...
>  ...
> }
> 
> typeC { ''C'':
>   optionA => ''A'',
>   optionB => ''B'',
> }
> 
> So, I would have to write the require in this case:
> 
> typeC { ''C'':
>   optionA => ''A'',
>   optionB => ''B'',
>   require => [ typeA[''A''],
typeB[''B''] ],
> }
> 
Do you mean a custom type you have defined with
    define typeC($optionA,$optionB) {
      ...
    }
or a custom type you are shipping as a plugin and is written in ruby? If
it is the latter you can use
    Puppet::Type.newtype(:typeC) do
      ...
      autorequire(:typeA) do
        self[:optionA]
      end
      autorequire(:typeB) do
        self[:optionB]
      end
    end
-Stefan
-- 
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.