Merge "Update share driver parameters"

This commit is contained in:
Jenkins 2015-04-20 15:02:48 +00:00 committed by Gerrit Code Review
commit f979bbdd4a
10 changed files with 264 additions and 94 deletions

View File

@ -1,6 +1,12 @@
# ==define manila::backend::generic # ==define manila::backend::generic
# #
# ===Parameters # ===Parameters
#
# [*driver_handles_share_servers*]
# (required) Denotes whether the driver should handle the responsibility of
# managing share servers. This must be set to false if the driver is to
# operate without managing share servers.
#
# [*share_backend_name*] # [*share_backend_name*]
# (optional) Name of the backend in manila.conf that # (optional) Name of the backend in manila.conf that
# these settings will reside in # these settings will reside in
@ -43,7 +49,12 @@
# Defaults to: ['CIFS=manila.share.drivers.generic.CIFSHelper', # Defaults to: ['CIFS=manila.share.drivers.generic.CIFSHelper',
# 'NFS=manila.share.drivers.generic.NFSHelper'] # 'NFS=manila.share.drivers.generic.NFSHelper']
# #
# [*cinder_volume_type*]
# (optional) Name or id of cinder volume type which will be used for all
# volumes created by driver.
#
define manila::backend::generic ( define manila::backend::generic (
$driver_handles_share_servers,
$share_backend_name = $name, $share_backend_name = $name,
$smb_template_config_path = '$state_path/smb.conf', $smb_template_config_path = '$state_path/smb.conf',
$volume_name_template = 'manila-share-%s', $volume_name_template = 'manila-share-%s',
@ -55,11 +66,13 @@ define manila::backend::generic (
$share_volume_fstype = 'ext4', $share_volume_fstype = 'ext4',
$share_helpers = ['CIFS=manila.share.drivers.generic.CIFSHelper', $share_helpers = ['CIFS=manila.share.drivers.generic.CIFSHelper',
'NFS=manila.share.drivers.generic.NFSHelper'], 'NFS=manila.share.drivers.generic.NFSHelper'],
$cinder_volume_type = undef,
) { ) {
$share_driver = 'manila.share.drivers.generic.GenericShareDriver' $share_driver = 'manila.share.drivers.generic.GenericShareDriver'
manila_config { manila_config {
"${name}/driver_handles_share_servers": value => $driver_handles_share_servers;
"${name}/share_backend_name": value => $share_backend_name; "${name}/share_backend_name": value => $share_backend_name;
"${name}/share_driver": value => $share_driver; "${name}/share_driver": value => $share_driver;
"${name}/smb_template_config_path": value => $smb_template_config_path; "${name}/smb_template_config_path": value => $smb_template_config_path;
@ -71,5 +84,6 @@ define manila::backend::generic (
"${name}/service_instance_smb_config_path": value => $service_instance_smb_config_path; "${name}/service_instance_smb_config_path": value => $service_instance_smb_config_path;
"${name}/share_volume_fstype": value => $share_volume_fstype; "${name}/share_volume_fstype": value => $share_volume_fstype;
"${name}/share_helpers": value => join($share_helpers, ','); "${name}/share_helpers": value => join($share_helpers, ',');
"${name}/cinder_volume_type": value => $cinder_volume_type;
} }
} }

View File

@ -4,86 +4,141 @@
# Compatible for multiple backends # Compatible for multiple backends
# #
# === Parameters # === Parameters
# NTAP: check if these parameters are actually optional or required #
# [*driver_handles_share_servers*]
# (required) Denotes whether the driver should handle the responsibility of
# managing share servers. This must be set to false if the driver is to
# operate without managing share servers.
#
# [*netapp_login*]
# (required) Administrative user account name used to access the storage
# system.
#
# [*netapp_password*]
# (required) Password for the administrative user account specified in the
# netapp_login parameter.
#
# [*netapp_server_hostname*]
# (required) The hostname (or IP address) for the storage system.
# #
# [*share_backend_name*] # [*share_backend_name*]
# (optional) Name of the backend in manila.conf that # (optional) Name of the backend in manila.conf that
# these settings will reside in # these settings will reside in
# #
# [*netapp_nas_transport_type*] # [*netapp_transport_type*]
# (optional) The transport protocol used when communicating with ONTAPI on the # (optional) The transport protocol used when communicating with
# storage system or proxy server. Valid values are http or https. # the storage system or proxy server. Valid values are
# http or https.
# Defaults to http # Defaults to http
# #
# [*netapp_nas_login*] # [*netapp_storage_family*]
# (required) Administrative user account name used to access the storage # (optional) The storage family type used on the storage system; valid
# system or proxy server. # values are ontap_cluster for clustered Data ONTAP.
# Defaults to ontap_cluster
# #
# [*netapp_nas_password*] # [*netapp_server_port*]
# (required) Password for the administrative user account specified in the # (optional) The TCP port to use for communication with the storage system
# netapp_nas_login parameter. # or proxy server. If not specified, Data ONTAP drivers will use 80 for HTTP
# and 443 for HTTPS.
# #
# [*netapp_nas_server_hostname*] # [*netapp_volume_name_template*]
# (required) The hostname (or IP address) for the storage system or proxy
# server.
#
# [*netapp_nas_volume_name_template*]
# (optional) NetApp volume name template. # (optional) NetApp volume name template.
# Defaults to share_%(share_id)s
#
# [*netapp_vserver*]
# (optional) This option specifies the storage virtual machine (previously
# called a Vserver) name on the storage cluster on which provisioning of
# shared file systems should occur. This option only applies
# when the option driver_handles_share_servers is set to False.
# #
# [*netapp_vserver_name_template*] # [*netapp_vserver_name_template*]
# (optional) Name template to use for new vserver. # (optional) Name template to use for new vserver. This option only applies
# when the option driver_handles_share_servers is set to True.
# Defaults to os_%s
# #
# [*netapp_lif_name_template*] # [*netapp_lif_name_template*]
# (optional) Lif name template # (optional) Logical interface (LIF) name template. This option only applies
# when the option driver_handles_share_servers is set to True.
# Defaults to os_%(net_allocation_id)s
# #
# [*netapp_aggregate_name_search_pattern*] # [*netapp_aggregate_name_search_pattern*]
# (optional) Pattern for searching available aggregates # (optional) Pattern for searching available aggregates
# for provisioning. # for provisioning.
# Defaults to (.*)
# #
# [*netapp_root_volume_aggregate*] # [*netapp_root_volume_aggregate*]
# (optional) Name of aggregate to create root volume on. # (optional) Name of aggregate to create root volume on. This option only
# applies when the option driver_handles_share_servers is set to True.
# #
# [*netapp_root_volume_name*] # [*netapp_root_volume_name*]
# (optional) Root volume name. # (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to root
#
# [*netapp_port_name_search_pattern*]
# (optional) Pattern for overriding the selection of network ports on which
# to create Vserver LIFs.
# Defaults to (.*)
#
# [*netapp_trace_flags*]
# (optional) This option is a comma-separated list of options (valid values
# include method and api) that controls which trace info is written to the
# Manila logs when the debug level is set to True
# #
# === Examples # === Examples
# #
# manila::backend::netapp { 'myBackend': # manila::backend::netapp { 'myBackend':
# netapp_nas_login => 'clusterAdmin', # driver_handles_share_servers => true,
# netapp_nas_password => 'password', # netapp_login => 'clusterAdmin',
# netapp_nas_server_hostname => 'netapp.mycorp.com', # netapp_password => 'password',
# netapp_nas_transport_type => 'https', # netapp_server_hostname => 'netapp.mycorp.com',
# netapp_storage_family => 'ontap_cluster',
# netapp_transport_type => 'https',
# } # }
define manila::backend::netapp ( define manila::backend::netapp (
$share_backend_name = $name, $driver_handles_share_servers,
$netapp_nas_transport_type = 'http', $netapp_login,
$netapp_nas_login = 'admin', $netapp_password,
$netapp_nas_password = undef, $netapp_server_hostname,
$netapp_nas_server_hostname = undef, $share_backend_name = $name,
$netapp_nas_volume_name_template = 'share_%(share_id)s', $netapp_transport_type = 'http',
$netapp_vserver_name_template = 'os_%s', $netapp_storage_family = 'ontap_cluster',
$netapp_lif_name_template = 'os_%(net_allocation_id)s', $netapp_server_port = undef,
$netapp_volume_name_template = 'share_%(share_id)s',
$netapp_vserver = undef,
$netapp_vserver_name_template = 'os_%s',
$netapp_lif_name_template = 'os_%(net_allocation_id)s',
$netapp_aggregate_name_search_pattern = '(.*)', $netapp_aggregate_name_search_pattern = '(.*)',
$netapp_root_volume_aggregate = undef, $netapp_root_volume_aggregate = undef,
$netapp_root_volume_name = 'root', $netapp_root_volume_name = 'root',
$netapp_port_name_search_pattern = '(.*)',
$netapp_trace_flags = undef,
) { ) {
$netapp_share_driver = 'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver' validate_string($netapp_password)
$netapp_share_driver = 'manila.share.drivers.netapp.common.NetAppDriver'
manila_config { manila_config {
"${share_backend_name}/share_backend_name": value => $share_backend_name;
"${share_backend_name}/share_driver": value => $netapp_share_driver; "${share_backend_name}/share_driver": value => $netapp_share_driver;
"${share_backend_name}/netapp_nas_transport_type": value => $netapp_nas_transport_type; "${share_backend_name}/driver_handles_share_servers": value => $driver_handles_share_servers;
"${share_backend_name}/netapp_nas_login": value => $netapp_nas_login; "${share_backend_name}/netapp_login": value => $netapp_login;
"${share_backend_name}/netapp_nas_password": value => $netapp_nas_password, secret => true; "${share_backend_name}/netapp_password": value => $netapp_password, secret => true;
"${share_backend_name}/netapp_nas_server_hostname": value => $netapp_nas_server_hostname; "${share_backend_name}/netapp_server_hostname": value => $netapp_server_hostname;
"${share_backend_name}/netapp_nas_volume_name_template": value => $netapp_nas_volume_name_template; "${share_backend_name}/share_backend_name": value => $share_backend_name;
"${share_backend_name}/netapp_transport_type": value => $netapp_transport_type;
"${share_backend_name}/netapp_storage_family": value => $netapp_storage_family;
"${share_backend_name}/netapp_server_port": value => $netapp_server_port;
"${share_backend_name}/netapp_volume_name_template": value => $netapp_volume_name_template;
"${share_backend_name}/netapp_vserver": value => $netapp_vserver;
"${share_backend_name}/netapp_vserver_name_template": value => $netapp_vserver_name_template; "${share_backend_name}/netapp_vserver_name_template": value => $netapp_vserver_name_template;
"${share_backend_name}/netapp_lif_name_template": value => $netapp_lif_name_template; "${share_backend_name}/netapp_lif_name_template": value => $netapp_lif_name_template;
"${share_backend_name}/netapp_aggregate_name_search_pattern": value => $netapp_aggregate_name_search_pattern; "${share_backend_name}/netapp_aggregate_name_search_pattern": value => $netapp_aggregate_name_search_pattern;
"${share_backend_name}/netapp_root_volume_aggregate": value => $netapp_root_volume_aggregate; "${share_backend_name}/netapp_root_volume_aggregate": value => $netapp_root_volume_aggregate;
"${share_backend_name}/netapp_root_volume_name": value => $netapp_root_volume_name; "${share_backend_name}/netapp_root_volume_name": value => $netapp_root_volume_name;
"${share_backend_name}/netapp_port_name_search_pattern": value => $netapp_port_name_search_pattern;
"${share_backend_name}/netapp_trace_flags": value => $netapp_trace_flags;
} }
package { 'nfs-utils': ensure => present } package { 'nfs-utils': ensure => present }

View File

@ -154,6 +154,10 @@
# (optional) Path to the rootwrap configuration file to use for # (optional) Path to the rootwrap configuration file to use for
# running commands as root # running commands as root
# #
# [*lock_path*]
# (optional) Location to store Manila locks
# Defaults to '/tmp/manila/manila_locks'
#
class manila ( class manila (
$sql_connection = 'sqlite:////var/lib/manila/manila.sqlite', $sql_connection = 'sqlite:////var/lib/manila/manila.sqlite',
$sql_idle_timeout = '3600', $sql_idle_timeout = '3600',
@ -198,6 +202,7 @@ class manila (
$debug = false, $debug = false,
$storage_availability_zone = 'nova', $storage_availability_zone = 'nova',
$rootwrap_config = '/etc/manila/rootwrap.conf', $rootwrap_config = '/etc/manila/rootwrap.conf',
$lock_path = '/tmp/manila/manila_locks',
) { ) {
include ::manila::params include ::manila::params
@ -362,6 +367,7 @@ class manila (
'DEFAULT/rpc_backend': value => $rpc_backend; 'DEFAULT/rpc_backend': value => $rpc_backend;
'DEFAULT/storage_availability_zone': value => $storage_availability_zone; 'DEFAULT/storage_availability_zone': value => $storage_availability_zone;
'DEFAULT/rootwrap_config': value => $rootwrap_config; 'DEFAULT/rootwrap_config': value => $rootwrap_config;
'DEFAULT/lock_path': value => $lock_path;
} }
if($sql_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) { if($sql_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {

View File

@ -3,6 +3,11 @@
# Configures Manila to use the generic share driver # Configures Manila to use the generic share driver
# #
# ===Parameters # ===Parameters
# [*driver_handles_share_servers*]
# (required) Denotes whether the driver should handle the responsibility of
# managing share servers. This must be set to false if the driver is to
# operate without managing share servers.
#
# [*smb_template_config_path*] # [*smb_template_config_path*]
# (optional) Path to smb config. # (optional) Path to smb config.
# Defaults to: $state_path/smb.conf # Defaults to: $state_path/smb.conf
@ -41,8 +46,13 @@
# Defaults to: ['CIFS=manila.share.drivers.generic.CIFSHelper', # Defaults to: ['CIFS=manila.share.drivers.generic.CIFSHelper',
# 'NFS=manila.share.drivers.generic.NFSHelper'] # 'NFS=manila.share.drivers.generic.NFSHelper']
# #
# [*cinder_volume_type*]
# (optional) Name or id of cinder volume type which will be used for all
# volumes created by driver.
#
class manila::share::generic ( class manila::share::generic (
$driver_handles_share_servers,
$smb_template_config_path = '$state_path/smb.conf', $smb_template_config_path = '$state_path/smb.conf',
$volume_name_template = 'manila-share-%s', $volume_name_template = 'manila-share-%s',
$volume_snapshot_name_template = 'manila-snapshot-%s', $volume_snapshot_name_template = 'manila-snapshot-%s',
@ -53,9 +63,11 @@ class manila::share::generic (
$share_volume_fstype = 'ext4', $share_volume_fstype = 'ext4',
$share_helpers = ['CIFS=manila.share.drivers.generic.CIFSHelper', $share_helpers = ['CIFS=manila.share.drivers.generic.CIFSHelper',
'NFS=manila.share.drivers.generic.NFSHelper'], 'NFS=manila.share.drivers.generic.NFSHelper'],
$cinder_volume_type = undef,
) { ) {
manila::backend::generic { 'DEFAULT': manila::backend::generic { 'DEFAULT':
driver_handles_share_servers => $driver_handles_share_servers,
smb_template_config_path => $smb_template_config_path, smb_template_config_path => $smb_template_config_path,
volume_name_template => $volume_name_template, volume_name_template => $volume_name_template,
volume_snapshot_name_template => $volume_snapshot_name_template, volume_snapshot_name_template => $volume_snapshot_name_template,
@ -65,5 +77,6 @@ class manila::share::generic (
service_instance_smb_config_path => $service_instance_smb_config_path, service_instance_smb_config_path => $service_instance_smb_config_path,
share_helpers => $share_helpers, share_helpers => $share_helpers,
share_volume_fstype => $share_volume_fstype, share_volume_fstype => $share_volume_fstype,
cinder_volume_type => $cinder_volume_type,
} }
} }

View File

@ -3,76 +3,128 @@
# Configures Manila to use the NetApp share driver # Configures Manila to use the NetApp share driver
# #
# === Parameters # === Parameters
# [*driver_handles_share_servers*]
# (required) Denotes whether the driver should handle the responsibility of
# managing share servers. This must be set to false if the driver is to
# operate without managing share servers.
# #
# [*netapp_nas_transport_type*] # [*netapp_login*]
# (optional) The transport protocol used when communicating with ONTAPI on the # (required) Administrative user account name used to access the storage
# storage system or proxy server. Valid values are http or https. # system.
#
# [*netapp_password*]
# (required) Password for the administrative user account specified in the
# netapp_login parameter.
#
# [*netapp_server_hostname*]
# (required) The hostname (or IP address) for the storage system.
#
# [*netapp_transport_type*]
# (optional) The transport protocol used when communicating with
# the storage system or proxy server. Valid values are
# http or https.
# Defaults to http # Defaults to http
# #
# [*netapp_nas_login*] # [*netapp_storage_family*]
# (required) Administrative user account name used to access the storage # (optional) The storage family type used on the storage system; valid
# system or proxy server. # values are ontap_cluster for clustered Data ONTAP.
# Defaults to ontap_cluster
# #
# [*netapp_nas_password*] # [*netapp_server_port*]
# (required) Password for the administrative user account specified in the # (optional) The TCP port to use for communication with the storage system
# netapp_nas_login parameter. # or proxy server. If not specified, Data ONTAP drivers will use 80 for HTTP
# and 443 for HTTPS.
# #
# [*netapp_nas_server_hostname*] # [*netapp_volume_name_template*]
# (required) The hostname (or IP address) for the storage system or proxy
# server.
#
# [*netapp_nas_volume_name_template*]
# (optional) NetApp volume name template. # (optional) NetApp volume name template.
# Defaults to share_%(share_id)s
#
# [*netapp_vserver*]
# (optional) This option specifies the storage virtual machine (previously
# called a Vserver) name on the storage cluster on which provisioning of
# shared file systems should occur. This option only applies
# when the option driver_handles_share_servers is set to False.
# #
# [*netapp_vserver_name_template*] # [*netapp_vserver_name_template*]
# (optional) Name template to use for new vserver. # (optional) Name template to use for new vserver. This option only applies
# when the option driver_handles_share_servers is set to True.
# Defaults to os_%s
# #
# [*netapp_lif_name_template*] # [*netapp_lif_name_template*]
# (optional) Lif name template # (optional) Logical interface (LIF) name template. This option only applies
# when the option driver_handles_share_servers is set to True.
# Defaults to os_%(net_allocation_id)s
# #
# [*netapp_aggregate_name_search_pattern*] # [*netapp_aggregate_name_search_pattern*]
# (optional) Pattern for searching available aggregates # (optional) Pattern for searching available aggregates
# for provisioning. # for provisioning.
# Defaults to (.*)
# #
# [*netapp_root_volume_aggregate*] # [*netapp_root_volume_aggregate*]
# (optional) Name of aggregate to create root volume on. # (optional) Name of aggregate to create root volume on. This option only
# applies when the option driver_handles_share_servers is set to True.
# #
# [*netapp_root_volume_name*] # [*netapp_root_volume_name*]
# (optional) Root volume name. # (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to root
#
# [*netapp_port_name_search_pattern*]
# (optional) Pattern for overriding the selection of network ports on which
# to create Vserver LIFs.
# Defaults to (.*)
#
# [*netapp_trace_flags*]
# (optional) This option is a comma-separated list of options (valid values
# include method and api) that controls which trace info is written to the
# Manila logs when the debug level is set to True
# #
# === Examples # === Examples
# class { 'manila::share::netapp': # class { 'manila::share::netapp':
# netapp_login => 'clusterAdmin', # driver_handles_share_servers => true,
# netapp_password => 'password', # netapp_login => 'clusterAdmin',
# netapp_server_hostname => 'netapp.mycorp.com', # netapp_password => 'password',
# netapp_server_port => '443', # netapp_server_hostname => 'netapp.mycorp.com',
# netapp_transport_type => 'https', # netapp_storage_family => 'ontap_cluster',
# netapp_vserver => 'openstack-vserver', # netapp_transport_type => 'https',
# } # }
# #
class manila::share::netapp ( class manila::share::netapp (
$netapp_nas_transport_type = 'http', $driver_handles_share_servers,
$netapp_nas_login = 'admin', $netapp_login,
$netapp_nas_password = undef, $netapp_password,
$netapp_nas_server_hostname = undef, $netapp_server_hostname,
$netapp_nas_volume_name_template= 'share_%(share_id)s', $netapp_transport_type = 'http',
$netapp_vserver_name_template = 'os_%s', $netapp_storage_family = 'ontap_cluster',
$netapp_lif_name_template = 'os_%(net_allocation_id)s', $netapp_server_port = undef,
$netapp_volume_name_template = 'share_%(share_id)s',
$netapp_vserver = undef,
$netapp_vserver_name_template = 'os_%s',
$netapp_lif_name_template = 'os_%(net_allocation_id)s',
$netapp_aggregate_name_search_pattern = '(.*)', $netapp_aggregate_name_search_pattern = '(.*)',
$netapp_root_volume_aggregate = undef, $netapp_root_volume_aggregate = undef,
$netapp_root_volume_name = 'root', $netapp_root_volume_name = 'root',
$netapp_port_name_search_pattern = '(.*)',
$netapp_trace_flags = undef,
) { ) {
manila::backend::netapp { 'DEFAULT': manila::backend::netapp { 'DEFAULT':
netapp_nas_transport_type => $netapp_nas_transport_type, driver_handles_share_servers => $driver_handles_share_servers,
netapp_nas_login => $netapp_nas_login, netapp_login => $netapp_login,
netapp_nas_password => $netapp_nas_password, netapp_password => $netapp_password,
netapp_nas_server_hostname => $netapp_nas_server_hostname, netapp_server_hostname => $netapp_server_hostname,
netapp_nas_volume_name_template => $netapp_nas_volume_name_template, netapp_transport_type => $netapp_transport_type,
netapp_storage_family => $netapp_storage_family,
netapp_server_port => $netapp_server_port,
netapp_volume_name_template => $netapp_volume_name_template,
netapp_vserver => $netapp_vserver,
netapp_vserver_name_template => $netapp_vserver_name_template, netapp_vserver_name_template => $netapp_vserver_name_template,
netapp_lif_name_template => $netapp_lif_name_template, netapp_lif_name_template => $netapp_lif_name_template,
netapp_aggregate_name_search_pattern => $netapp_aggregate_name_search_pattern, netapp_aggregate_name_search_pattern => $netapp_aggregate_name_search_pattern,
netapp_root_volume_aggregate => $netapp_root_volume_aggregate, netapp_root_volume_aggregate => $netapp_root_volume_aggregate,
netapp_root_volume_name => $netapp_root_volume_name, netapp_root_volume_name => $netapp_root_volume_name,
netapp_port_name_search_pattern => $netapp_port_name_search_pattern,
netapp_trace_flags => $netapp_trace_flags,
} }
} }

View File

@ -4,6 +4,7 @@ describe 'manila::share::generic' do
let :params do let :params do
{ {
:driver_handles_share_servers => true,
:smb_template_config_path => '$state_path/smb.conf', :smb_template_config_path => '$state_path/smb.conf',
:volume_name_template => 'manila-share-%s', :volume_name_template => 'manila-share-%s',
:volume_snapshot_name_template => 'manila-snapshot-%s', :volume_snapshot_name_template => 'manila-snapshot-%s',
@ -12,6 +13,7 @@ describe 'manila::share::generic' do
:max_time_to_attach => 120, :max_time_to_attach => 120,
:service_instance_smb_config_path => '$share_mount_path/smb.conf', :service_instance_smb_config_path => '$share_mount_path/smb.conf',
:share_volume_fstype => 'ext4', :share_volume_fstype => 'ext4',
:cinder_volume_type => 'gold',
} }
end end

View File

@ -4,21 +4,27 @@ describe 'manila::share::netapp' do
let :params do let :params do
{ {
:netapp_nas_login => 'netapp', :driver_handles_share_servers => true,
:netapp_nas_password => 'password', :netapp_login => 'netapp',
:netapp_nas_server_hostname => '127.0.0.2', :netapp_password => 'password',
:netapp_root_volume_aggregate => 'aggr1', :netapp_server_hostname => '127.0.0.2',
:netapp_server_port => '443',
:netapp_vserver => 'manilasvm',
:netapp_root_volume_aggregate => 'aggr1',
:netapp_trace_flags => 'method,api',
} }
end end
let :default_params do let :default_params do
{ {
:netapp_nas_transport_type => 'http', :netapp_transport_type => 'http',
:netapp_nas_volume_name_template => 'share_%(share_id)s', :netapp_storage_family => 'ontap_cluster',
:netapp_volume_name_template => 'share_%(share_id)s',
:netapp_vserver_name_template => 'os_%s', :netapp_vserver_name_template => 'os_%s',
:netapp_lif_name_template => 'os_%(net_allocation_id)s', :netapp_lif_name_template => 'os_%(net_allocation_id)s',
:netapp_aggregate_name_search_pattern => '(.*)', :netapp_aggregate_name_search_pattern => '(.*)',
:netapp_root_volume_name => 'root', :netapp_root_volume_name => 'root',
:netapp_port_name_search_pattern => '(.*)',
} }
end end
@ -30,14 +36,14 @@ describe 'manila::share::netapp' do
it 'configures netapp share driver' do it 'configures netapp share driver' do
is_expected.to contain_manila_config('DEFAULT/share_driver').with_value( is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver') 'manila.share.drivers.netapp.common.NetAppDriver')
params_hash.each_pair do |config,value| params_hash.each_pair do |config,value|
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value ) is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
end end
end end
it 'marks netapp_password as secret' do it 'marks netapp_password as secret' do
is_expected.to contain_manila_config('DEFAULT/netapp_nas_password').with_secret( true ) is_expected.to contain_manila_config('DEFAULT/netapp_password').with_secret( true )
end end
end end
@ -53,4 +59,5 @@ describe 'manila::share::netapp' do
context 'with provided parameters' do context 'with provided parameters' do
it_configures 'netapp share driver' it_configures 'netapp share driver'
end end
end end

View File

@ -67,6 +67,9 @@ describe 'manila' do
is_expected.to contain_manila_config('DEFAULT/rootwrap_config').with( is_expected.to contain_manila_config('DEFAULT/rootwrap_config').with(
:value => '/etc/manila/rootwrap.conf' :value => '/etc/manila/rootwrap.conf'
) )
is_expected.to contain_manila_config('DEFAULT/lock_path').with(
:value => '/tmp/manila/manila_locks'
)
is_expected.to contain_manila_config('DEFAULT/log_dir').with(:value => '/var/log/manila') is_expected.to contain_manila_config('DEFAULT/log_dir').with(:value => '/var/log/manila')
end end

View File

@ -6,6 +6,7 @@ describe 'manila::backend::generic' do
let :params do let :params do
{ {
:driver_handles_share_servers => true,
:smb_template_config_path => '$state_path/smb.conf', :smb_template_config_path => '$state_path/smb.conf',
:volume_name_template => 'manila-share-%s', :volume_name_template => 'manila-share-%s',
:volume_snapshot_name_template => 'manila-snapshot-%s', :volume_snapshot_name_template => 'manila-snapshot-%s',
@ -14,6 +15,7 @@ describe 'manila::backend::generic' do
:max_time_to_attach => 120, :max_time_to_attach => 120,
:service_instance_smb_config_path => '$share_mount_path/smb.conf', :service_instance_smb_config_path => '$share_mount_path/smb.conf',
:share_volume_fstype => 'ext4', :share_volume_fstype => 'ext4',
:cinder_volume_type => 'gold',
} }
end end

View File

@ -6,21 +6,27 @@ describe 'manila::backend::netapp' do
let :params do let :params do
{ {
:netapp_nas_login => 'netapp', :driver_handles_share_servers => true,
:netapp_nas_password => 'password', :netapp_login => 'netapp',
:netapp_nas_server_hostname => '127.0.0.2', :netapp_password => 'password',
:netapp_root_volume_aggregate => 'aggr1', :netapp_server_hostname => '127.0.0.2',
:netapp_server_port => '443',
:netapp_vserver => 'manilasvm',
:netapp_root_volume_aggregate => 'aggr1',
:netapp_trace_flags => 'method,api',
} }
end end
let :default_params do let :default_params do
{ {
:netapp_nas_transport_type => 'http', :netapp_transport_type => 'http',
:netapp_nas_volume_name_template => 'share_%(share_id)s', :netapp_storage_family => 'ontap_cluster',
:netapp_volume_name_template => 'share_%(share_id)s',
:netapp_vserver_name_template => 'os_%s', :netapp_vserver_name_template => 'os_%s',
:netapp_lif_name_template => 'os_%(net_allocation_id)s', :netapp_lif_name_template => 'os_%(net_allocation_id)s',
:netapp_aggregate_name_search_pattern => '(.*)', :netapp_aggregate_name_search_pattern => '(.*)',
:netapp_root_volume_name => 'root', :netapp_root_volume_name => 'root',
:netapp_port_name_search_pattern => '(.*)',
} }
end end
@ -31,14 +37,14 @@ describe 'manila::backend::netapp' do
it 'configures netapp share driver' do it 'configures netapp share driver' do
is_expected.to contain_manila_config("mynetapp/share_driver").with_value( is_expected.to contain_manila_config("mynetapp/share_driver").with_value(
'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver') 'manila.share.drivers.netapp.common.NetAppDriver')
params_hash.each_pair do |config,value| params_hash.each_pair do |config,value|
is_expected.to contain_manila_config("mynetapp/#{config}").with_value( value ) is_expected.to contain_manila_config("mynetapp/#{config}").with_value( value )
end end
end end
it 'marks netapp_password as secret' do it 'marks netapp_password as secret' do
is_expected.to contain_manila_config("mynetapp/netapp_nas_password").with_secret( true ) is_expected.to contain_manila_config("mynetapp/netapp_password").with_secret( true )
end end
end end
@ -55,4 +61,14 @@ describe 'manila::backend::netapp' do
it_configures 'netapp share driver' it_configures 'netapp share driver'
end end
context 'with share server config' do
before do
params.merge!({
:netapp_password => true,
})
end
it { is_expected.to raise_error(Puppet::Error, /true is not a string. It looks to be a TrueClass/) }
end
end end