Am Mittwoch, 13. März 2013 17:00:18 UTC+1 schrieb jcbollinger:
>
>
> My problem now is that I don't know how to implement "ensure" for this
>> case, as I cannot use "ensurable" in the type.
>>
>
> Your problem is that you are conflating distinct (for your purposes)
> aspects of your resource's state. If you care at times whether the
> variable is declared at all or not, and at other times what its value is,
> then those should be separate properties. Your resource declarations will
> then look like this:
>
> env_var { 'AWESOMENESS':
> value => 'meh',
> # optional:
> ensure => present
> }
>
> or
>
> env_var { 'AWESOMENESS':
> ensure => absent
> }
>
I've changed the logic of exists? a bit to reflect this, and it works.
However, one has to remember not to provide a value if "ensure => absent"
was specified. Or is there a way to check this in the provider?
Thanks...
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.