diff --git a/manifests/backend/netapp.pp b/manifests/backend/netapp.pp index 4c714134..d14f03d3 100644 --- a/manifests/backend/netapp.pp +++ b/manifests/backend/netapp.pp @@ -105,6 +105,11 @@ # (optional) File with the list of available NFS shares # Defaults to '/etc/cinder/shares.conf' # +# [*nfs_mount_options*] +# (optional) Mount options passed to the nfs client. See section +# of the nfs man page for details. +# Defaults to undef +# # [*netapp_copyoffload_tool_path*] # (optional) This option specifies the path of the NetApp Copy Offload tool # binary. Ensure that the binary has execute permissions set which allow the @@ -188,6 +193,7 @@ define cinder::backend::netapp ( $thres_avl_size_perc_stop = '60', $nfs_shares = undef, $nfs_shares_config = '/etc/cinder/shares.conf', + $nfs_mount_options = undef, $netapp_copyoffload_tool_path = undef, $netapp_controller_ips = undef, $netapp_sa_password = undef, @@ -206,6 +212,16 @@ define cinder::backend::netapp ( } } + if $nfs_mount_options { + cinder_config { + "${volume_backend_name}/nfs_mount_options": value => $nfs_mount_options; + } + } else { + cinder_config { + "${volume_backend_name}/nfs_mount_options": ensure => absent; + } + } + cinder_config { "${volume_backend_name}/volume_backend_name": value => $volume_backend_name; "${volume_backend_name}/volume_driver": value => 'cinder.volume.drivers.netapp.common.NetAppDriver'; diff --git a/manifests/volume/netapp.pp b/manifests/volume/netapp.pp index 4fc3066d..660ca36f 100644 --- a/manifests/volume/netapp.pp +++ b/manifests/volume/netapp.pp @@ -104,6 +104,11 @@ # (optional) File with the list of available NFS shares # Defaults to '/etc/cinder/shares.conf' # +# [*nfs_mount_options*] +# (optional) Mount options passed to the nfs client. See section +# of the nfs man page for details. +# Defaults to undef +# # [*netapp_copyoffload_tool_path*] # (optional) This option specifies the path of the NetApp Copy Offload tool # binary. Ensure that the binary has execute permissions set which allow the @@ -192,6 +197,7 @@ class cinder::volume::netapp ( $netapp_storage_pools = undef, $netapp_eseries_host_type = 'linux_dm_mp', $netapp_webservice_path = '/devmgr/v2', + $nfs_mount_options = undef, $extra_options = {}, ) { @@ -219,6 +225,7 @@ class cinder::volume::netapp ( netapp_storage_pools => $netapp_storage_pools, netapp_eseries_host_type => $netapp_eseries_host_type, netapp_webservice_path => $netapp_webservice_path, + nfs_mount_options => $nfs_mount_options, extra_options => $extra_options, } } diff --git a/spec/classes/cinder_volume_netapp_spec.rb b/spec/classes/cinder_volume_netapp_spec.rb index b2ce5c20..7a1f92b1 100644 --- a/spec/classes/cinder_volume_netapp_spec.rb +++ b/spec/classes/cinder_volume_netapp_spec.rb @@ -30,6 +30,7 @@ describe 'cinder::volume::netapp' do :thres_avl_size_perc_stop => '60', :nfs_shares_config => '/etc/cinder/shares.conf', :netapp_eseries_host_type => 'linux_dm_mp', + :nfs_mount_options => nil, :netapp_webservice_path => '/devmgr/v2', } end diff --git a/spec/defines/cinder_backend_netapp_spec.rb b/spec/defines/cinder_backend_netapp_spec.rb index 2bdc0efa..04900002 100644 --- a/spec/defines/cinder_backend_netapp_spec.rb +++ b/spec/defines/cinder_backend_netapp_spec.rb @@ -33,6 +33,7 @@ describe 'cinder::backend::netapp' do :thres_avl_size_perc_stop => '60', :nfs_shares_config => '/etc/cinder/shares.conf', :netapp_eseries_host_type => 'linux_dm_mp', + :nfs_mount_options => nil, :netapp_webservice_path => '/devmgr/v2', } end @@ -80,6 +81,14 @@ describe 'cinder::backend::netapp' do it { is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/use_multipath_for_image_xfer").with_value('true') } end + context 'with NFS mount options' do + let (:req_params) { params.merge!({ + :nfs_mount_options => 'rw,proto=tcp,sec=sys', + }) } + + it { is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/nfs_mount_options").with_value('rw,proto=tcp,sec=sys') } + end + context 'netapp backend with additional configuration' do before do params.merge!({:extra_options => {'hippo/param1' => { 'value' => 'value1' }}})