John, thanks a lot for your answers.

I was doing it this way at first, but I thought that providing native type 
would be much simpler for end users.

The same way puppet is providing native types for Nagios I wanted to create 
native type for the application I need.

Anyway I'll get back to defined type and class ;)

Thanks again,

On Tuesday, June 26, 2012 1:07:41 PM UTC+2, Yanis Guenane wrote:
>
> Hey guys,
>
> I was wondering if it was possible to access type params within another 
> type.
>
> Here is an example of what I would like to do.
>
> Puppet::Type.newtype(:a) do
>>
>      newparam(:name) do
>>       isnamevar
>>      end
>>
>       newparam(:path) do
>>       end
>> end
>>
>
> Puppet::Type.newtype(:b) do
>>
>    newparam(:name) do
>>     isnamevar
>>    end 
>>
>    newparam(:needs) do
>>   
>>    /* I want to access path param from 'a' type here 
>
>       something like resource[:needs].path */
>>
>
>>    end
>> end
>>
>
> And the manifest calling that would be 
>
>  a {'test-a' :
>> path => '/usr',
>> }
>>
>>  b {'test-b' :
>> needs => a
>> }
>>  
>>
>
>
> Is it possible ? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/ouzxtGDl8EkJ.
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