After a quick google, came up with:
#!/usr/bin/env ruby
>
> grades = { "Bob" => 82,
> "Jim" => 94,
> "Billy" => 58
> }
>
> grades.each do|name,grade|
> puts "#{name}: #{grade}"
> end
So now all I need to do is pull the existing options values and compile a
hash to compare in the exists?, and use the above in the create...
Quick question on the create - how will it handle one property that
matches, but one property that doesn't?
Cheers
Gavin
On Tuesday, 13 November 2012 19:04:31 UTC, Gavin Williams wrote:
>
> Nan
>
> Cheers for the response.
>
> Yes this is just a parameter...
>
> What's the easiest way to work with them in the provider?
>
> Cheers
> Gavin
> On Nov 13, 2012 7:00 PM, "Nan Liu" <[email protected]> wrote:
>
>> On Tue, Nov 13, 2012 at 7:33 AM, fatmcgav <[email protected]> wrote:
>>
>>> One of the functions required is the ability to set 'options' against a
>>> given volume.
>>> What I want to do is create a provider that accepts a volume name and a
>>> list of volume options with their corresponding settings, and then iterate
>>> through the provided list making a webservice call for each option.
>>>
>>> So to give a better example of the provider in pastebin:
>>> netapp_volume_options { 'v_puppet_test12111508':
>>> options => ['convert_ucode=on', 'no_atime_update=on'],
>>> }
>>>
>>
>> Yeah this seems to make more sense as a hash:
>>
>> options => { 'convert_ucode' => 'on', 'no_atime_update' => 'on' }
>>
>> I'm assuming this is just parameter, if it's a property add the following
>> method to the type and you should get a reasonable output:
>>
>> def should_to_s(v)
>> v.inspect
>> end
>>
>> def is_to_s(v)
>> v.inspect
>> end
>>
>> Thanks,
>>
>> Nan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> 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.
>>
>
--
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/-/mc453A4A648J.
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.