Ok, I've just pushed the latest code to Github:
https://github.com/fatmcgav/fatmcgav-netapp/commit/d5ae999fc49b1de6726e8f4b7027648cf2eb64a2
I've managed to get the *create *functioning correctly, and updating the
NetApp options as required.
*exists?* has also been fleshed out a lot.
Logic is that it will pull back a list of the current options set against
the referenced volume, and then construct a hash of the returned key=>value
pairs.
The matching keys are then pulled from the current options and the setting
options hashes, and the values of those keys compared.
If they are different, then the *create *should be triggered.
This is working fine in principle.
However the current issue is that the *exists?* will *return false*whenever a
single property value doesn't match. The create will then
process the whole list of setting options, rather than just the mis-matched
one(s)...
An example run gives:
^[[0;36mDebug^[[0m: Puppet::Provider::netapp_volume_options: Matched Name
> no_atime_update. Current value = off. New value = on
> ^[[0;36mDebug^[[0m: Puppet::Provider::netapp_volume_options:
> no_atime_update values don't match.
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: setting
> Netapp Volume options against volume v_puppet_test12111508.
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: Setting =
> no_atime_update, Value = on
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: Volume Option
> no_atime_update set against Volume v_puppet_test12111508.
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: Setting =
> convert_ucode, Value = on
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: Volume Option
> convert_ucode set against Volume v_puppet_test12111508.
> ^[[0;36mDebug^[[0m: Puppet::Provider::Netapp_volume_options: Volume
> Options set successfully against Volume v_puppet_test12111508.
>
This is based on a config of:
>
> netapp_volume_options { 'v_puppet_test12111508':
> options => {'convert_ucode' => 'on', 'no_atime_update' =>
> 'on'},
> require => Netapp_volume['v_puppet_test12111508']
> }
>
>
*convert_ucode* should match, and *no_atime_update* obviously didn't...
Any ideas?
Haven't as yet done anything with *insync?* yet, as if I'm honest it
slightly baffles me currently...
Cheers
Gavin
On Tuesday, 13 November 2012 21:57:01 UTC, Nan Liu wrote:
>
> On Tue, Nov 13, 2012 at 11:58 AM, fatmcgav <[email protected]<javascript:>
> > wrote:
>
>> Looks like overriding the 'insync?' method is the way to go, as I'm only
>> interested in checking/setting property values that are being passed
>> through...
>>
>> Any insync? examples that I could refer to?
>>
>
> There's a simple example here:
>
> https://github.com/puppetlabs/puppetlabs-f5/blob/master/lib/puppet/type/f5_virtualserver.rb#L13-15
>
> Search puppet source code lib/puppet/type/ for additional ones.
>
> Thanks,
>
> Nan
>
--
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/-/rKYLDjFxXJAJ.
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-users?hl=en.