Philip Brown
unread,May 3, 2012, 9:18:15 PM5/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppe...@googlegroups.com
Hi folks,
I'm trying to write a new provider, to set SMF properties, and I need help on a piece of puppet internals syntax.
I understand(?) that generally speaking when a resource has a KNOWN set of property names, for example, "quota" and "readonly", all you have to do to properly handle that sort of thing is,
def quota
(return value of quota)
end
def quota=
(set quota to be equal to :name value)
end
However, I'm trying to write a provider, where the property names are free-form.
From the end user point of view, usage should look something like
###site.pp
node somenode{
mynewtype { 'svc:/top/level/holder':
property => 'funky_holder_switch',
value => 'blue_switch'
}
}
#####
The name of the value in "property" is completely unknown to me at time of writing the provider code. it could be literally anything the user chooses.
How can I handle that?
For the curious, I already figure that the end result, will be a command line that looks like
svccfg("-s", @resource[:name],"setprop", @resource[:property],"=", :value)
I know how to do that backend part. and I've written the front end 'type' definition. I'm just missing the trick of finding the middle layer glue to connect the two together :-}