Remove deprecated manila::service_instance
This defined type was deprecated by [1].
[1] 8005513f41
Change-Id: I8d71ac0ab9fa4a97bc1f5df9a274209198183ddb
This commit is contained in:
parent
66890b154c
commit
0d31bdbdaf
@ -1,122 +0,0 @@
|
||||
# ==define manila::service_instance
|
||||
#
|
||||
# ===Parameters
|
||||
#
|
||||
# [*service_instance_user*]
|
||||
# (required) User in service instance.
|
||||
#
|
||||
# [*service_instance_password*]
|
||||
# (required) Password to service instance user.
|
||||
#
|
||||
# [*create_service_image*]
|
||||
# (optional) Upload the service image to glance.
|
||||
# Defaults to: true
|
||||
#
|
||||
# [*service_image_name*]
|
||||
# (optional) Name of image in glance, that will be used to create
|
||||
# service instance.
|
||||
# Defaults to: 'manila-service-image'
|
||||
#
|
||||
# [*service_image_location*]
|
||||
# (optional) URL or pathname to the service image. This will be
|
||||
# loaded into Glance. This is required when create_service_image is true.
|
||||
#
|
||||
# [*service_instance_name_template*]
|
||||
# (optional) Name of service instance.
|
||||
# Defaults to: 'manila_service_instance_%s'
|
||||
#
|
||||
# [*manila_service_keypair_name*]
|
||||
# (optional) Name of keypair that will be created and used
|
||||
# for service instance.
|
||||
# Defaults to: 'manila-service'
|
||||
#
|
||||
# [*path_to_public_key*]
|
||||
# (optional) Path to hosts public key.
|
||||
# Defaults to: '~/.ssh/id_rsa.pub'
|
||||
#
|
||||
# [*path_to_private_key*]
|
||||
# (optional) Path to hosts private key.
|
||||
# Defaults to: '~/.ssh/id_rsa'
|
||||
#
|
||||
# [*max_time_to_build_instance*]
|
||||
# (optional) Maximum time to wait for creating service instance.
|
||||
# Defaults to: 300
|
||||
#
|
||||
# [*service_instance_security_group*]
|
||||
# (optional) Name of security group, that will be used for
|
||||
# service instance creation.
|
||||
# Defaults to: 'manila-service'
|
||||
#
|
||||
# [*service_instance_flavor_id*]
|
||||
# (optional) ID of flavor, that will be used for service instance
|
||||
# creation.
|
||||
# Defaults to: 1
|
||||
#
|
||||
# [*service_network_name*]
|
||||
# (optional) Name of manila service network.
|
||||
# Defaults to: 'manila_service_network'
|
||||
#
|
||||
# [*service_network_cidr*]
|
||||
# (optional) CIDR of manila service network.
|
||||
# Defaults to: '10.254.0.0/16'
|
||||
#
|
||||
# [*service_network_division_mask*]
|
||||
# (optional) This mask is used for dividing service network into
|
||||
# subnets, IP capacity of subnet with this mask directly
|
||||
# defines possible amount of created service VMs
|
||||
# per tenant's subnet.
|
||||
# Defaults to: 28
|
||||
#
|
||||
# [*interface_driver*]
|
||||
# (optional) Vif driver.
|
||||
# Defaults to: 'manila.network.linux.interface.OVSInterfaceDriver'
|
||||
#
|
||||
# [*connect_share_server_to_tenant_network*]
|
||||
# (optional) Attach share server directly to share network.
|
||||
# Defaults to: false
|
||||
#
|
||||
define manila::service_instance (
|
||||
$service_instance_user,
|
||||
$service_instance_password,
|
||||
$create_service_image = true,
|
||||
$service_image_name = 'manila-service-image',
|
||||
$service_image_location = undef,
|
||||
$service_instance_name_template = 'manila_service_instance_%s',
|
||||
$manila_service_keypair_name = 'manila-service',
|
||||
$path_to_public_key = '~/.ssh/id_rsa.pub',
|
||||
$path_to_private_key = '~/.ssh/id_rsa',
|
||||
$max_time_to_build_instance = 300,
|
||||
$service_instance_security_group = 'manila-service',
|
||||
$service_instance_flavor_id = 1,
|
||||
$service_network_name = 'manila_service_network',
|
||||
$service_network_cidr = '10.254.0.0/16',
|
||||
$service_network_division_mask = 28,
|
||||
$interface_driver = 'manila.network.linux.interface.OVSInterfaceDriver',
|
||||
$connect_share_server_to_tenant_network = false,
|
||||
) {
|
||||
|
||||
include manila::deps
|
||||
|
||||
warning('The manila::service_instance defined type has been deprecated. \
|
||||
use the manila::backend::service_instance defined type.')
|
||||
|
||||
manila::backend::service_instance { $name:
|
||||
service_instance_user => $service_instance_user,
|
||||
service_instance_password => $service_instance_password,
|
||||
create_service_image => $create_service_image,
|
||||
service_image_name => $service_image_name,
|
||||
service_image_location => $service_image_location,
|
||||
service_instance_name_template => $service_instance_name_template,
|
||||
manila_service_keypair_name => $manila_service_keypair_name,
|
||||
path_to_public_key => $path_to_public_key,
|
||||
path_to_private_key => $path_to_private_key,
|
||||
max_time_to_build_instance => $max_time_to_build_instance,
|
||||
service_instance_security_group => $service_instance_security_group,
|
||||
service_instance_flavor_id => $service_instance_flavor_id,
|
||||
service_network_name => $service_network_name,
|
||||
service_network_cidr => $service_network_cidr,
|
||||
service_network_division_mask => $service_network_division_mask,
|
||||
interface_driver => $interface_driver,
|
||||
connect_share_server_to_tenant_network => $connect_share_server_to_tenant_network,
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The deprecated ``manila::service_instance`` defined resource type has been
|
||||
removed. Use the ``manila::backend::service_instance`` defined resource
|
||||
type instead.
|
@ -1,78 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'manila::service_instance' do
|
||||
|
||||
let(:title) {'DEFAULT'}
|
||||
|
||||
let :params do
|
||||
{
|
||||
:create_service_image => true,
|
||||
:service_instance_name_template => 'manila_service_instance_%s',
|
||||
:service_instance_user => 'user1',
|
||||
:service_instance_password => 'pass1',
|
||||
:manila_service_keypair_name => 'manila-service',
|
||||
:path_to_public_key => '~/.ssh/id_rsa.pub',
|
||||
:path_to_private_key => '~/.ssh/id_rsa',
|
||||
:max_time_to_build_instance => 300,
|
||||
:service_instance_security_group => 'manila-service',
|
||||
:service_instance_flavor_id => 1,
|
||||
:service_network_name => 'manila_service_network',
|
||||
:service_network_cidr => '10.254.0.0/16',
|
||||
:service_network_division_mask => 28,
|
||||
:interface_driver => 'manila.network.linux.interface.OVSInterfaceDriver',
|
||||
:connect_share_server_to_tenant_network => false,
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples 'manila::service_instance' do
|
||||
context 'with default parameters' do
|
||||
it 'configures service instance' do
|
||||
expect {
|
||||
params.each_pair do |config,value|
|
||||
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
|
||||
end
|
||||
}.to raise_error(Puppet::Error, /Missing required parameter service_image_location/)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with service image provided' do
|
||||
let (:req_params) { params.merge!({
|
||||
:service_image_name => 'manila-service-image',
|
||||
:service_image_location => 'http://example.com/manila_service_image.iso',
|
||||
}) }
|
||||
|
||||
it 'creates Glance image' do
|
||||
is_expected.to contain_glance_image(req_params[:service_image_name]).with(
|
||||
:ensure => 'present',
|
||||
:is_public => 'yes',
|
||||
:container_format => 'bare',
|
||||
:disk_format => 'qcow2',
|
||||
:source => req_params[:service_image_location]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with create_service_image false' do
|
||||
let (:req_params) { params.merge!({
|
||||
:create_service_image => false,
|
||||
:service_image_name => 'manila-service-image',
|
||||
}) }
|
||||
|
||||
it 'does not create Glance image' do
|
||||
is_expected.to_not contain_glance_image(req_params[:service_image_name])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'manila::service_instance'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user