On Saturday, May 5, 2012 7:42:43 PM UTC-7, Luke Kanies wrote:
>
>
> Sorry - I meant it needs to be in the definition of the relevant property,
> which in this case is 'ensure' (but in exec is 'returns').
>
>
For those "following along at home", that apparently means that, rather
than the nice simple (but apparently, OVERLY simplified)
single line of
"ensurable"
in a type definition, I now have to do:
ensurable do
defaultvalues
# This appears to be "change to state", for "ensurable"s.
def change_to_s(oldstate,newstate)
if ( oldstate == :absent && newstate == :present )
return "set #{@resource[:property]} = #{@resource[:value]}"
end
end
end
This stuff may as well be black magic. it reaaally needs to be added to the
"how to write your own type" documentation!! :(
It is not at all apparent, than a single line,
"ensurable" is some short cut for an expandable "property definition"
Similarly for the "defaultvalues" line. not particular understandable, but
"it just has to be there".
(At least I have C++/java experience, so I can guess how it works. but for
someone else trying to learn how to write their own types, etc. .. yuck)
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-dev/-/gJyBNVcKXw4J.
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-dev?hl=en.