Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Provider
- require 'puppet/provider/netapp'
- Puppet::Type.type(:netapp_volume_options).provide(:netapp_volume_options, :parent => Puppet::Provider::Netapp) do
- @doc = "Manage Netapp Volume option modification and deletion for existing volumes."
- confine :feature => :posix
- defaultfor :feature => :posix
- def create
- Puppet.debug("Puppet::Provider::netapp_volume_options: setting Netapp Volume options against volume #{@resource[:name]}.")
- Puppet.debug("Puppet::Provider::netapp_volume_options: Options: #{@resource[:options]}")
- options = @resource[:options]
- options.each do |option|
- Puppet.debug("Puppet::Provider::netapp_volume_options: Option: #{option}")
- value = split(option, '=')
- value.each do |val|
- Puppet.debug("Puppet::Provider::netapp_volume_options: Val = #{val}")
- end
- end
- def destroy
- Puppet.debug("Puppet::Provider::netapp_volume_options: destroying Netapp Volume #{@resource[:name]}")
- end
- def exists?
- Puppet.debug("Puppet::Provider::netapp_volume_options: checking value of Netapp Volume option on Volume #{@resource[:name]}")
- return false
- end
- end
- -- Type
- Puppet::Type.newtype(:netapp_volume_options) do
- @doc = "Manage Netapp Volume Option modification."
- apply_to_device
- ensurable do
- desc "Netapp Volume resource state. Valid values are: present, absent."
- defaultto(:present)
- newvalue(:present) do
- provider.create
- end
- newvalue(:absent) do
- provider.destroy
- end
- end
- newparam(:name) do
- desc "The volume name to set options against."
- isnamevar
- end
- newparam(:options, :array_matching => :all) do
- desc "Array of options to be applied to this volume."
- end
- end
- -- Node config
- netapp_volume_options { 'v_puppet_test12111508':
- options => ['x=a', 'y=b']
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement