Hi,

I currently trying to develop a custom type with Puppet Resource API.
Using this documentation:
https://github.com/puppetlabs/puppet-specifications/blob/master/language/resource-api/README.md
I managed to develop something that works with attributes of behavior 
'namevar' and 'readonly'.
I would like to create a new attributes of behavior 'parameter' to 
influence how the provider behaves (quoting the doc).
But I don't understand how you could use this kind of attributes in the 
provider.

Here is what I want to do :
My custom type manages host ssh keys : The current attributes are type 
(dsa, rsa, etc.), length (of the key), comment and 2 'read_only' attributes 
: the file path of private ssh key (/etc/ssh/ssh_host_rsa_key) and 'age' 
(the number of days since the creation of the key - based on the key file 
modification time). The 'type' and 'length' are both 'namevar'.
All of this works as expected :-)
Now i want to add an attribute 'parameter' called 'maxdays' and implement 
the following behavior: If read-only attribute 'age' is greater that 
attributes parameter 'maxdays', I want to trigger the generation of a new 
key.

I don't see a way in the get method to tell Puppet that since 'age' is 
greater that 'maxdays', it should call the set method to change the state 
of the system (ie. generate a new key). 

Is this doable with Puppet Resource API ?
If yes, could you show me the way please ?

Thanks in advance for your help.

Regards,
Fred


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/87019d6c-1415-4de6-a611-2313e279b021%40googlegroups.com.

Reply via email to