Updating nova and neutron configuration

Since we stopped support of keystonev2, we need to be able to specify a
domain in neutron and nova configuration. Might as well add all the
options and remove the deprecated ones.

Co-authored-by: Victoria Martinez de la Cruz <victoria@redhat.com>
Change-Id: I745a170ac4458a3f13efc255fc37540a11b54274
Closes-Bug: #1802393
This commit is contained in:
David Vallee Delisle 2018-11-08 17:09:45 -05:00 committed by Victoria Martinez de la Cruz
parent 8784790e71
commit 5ae8e2882b
5 changed files with 467 additions and 151 deletions

View File

@ -4,62 +4,170 @@
#
# === Parameters
#
# [*insecure*]
# (optional) Verify HTTPS connections
# Defaults to $::os_service_default
#
# [*auth_url*]
# (optional) Authentication URL
# Defaults to $::os_service_default
#
# [*auth_type*]
# (optional) Authentication type to load
# Defaults to $::os_service_default
#
# [*cafile*]
# (optional) PEM encoded Certificate Authority to use when verifying HTTPS
# connections.
# Defaults to $::os_service_default
#
# [*user_domain_name*]
# (optional) User's domain name
# Defaults to 'Default'
#
# [*project_domain_name*]
# (optional) Domain name containing project
# Defaults to 'Default'
#
# [*project_name*]
# (optional) Project name to scope to
# Defaults to 'service'
#
# [*region_name*]
# (optional) Region name for connecting to nova
# Defaults to $::os_service_default
#
# [*endpoint_type*]
# (optional) The type of nova endpoint to use when
# looking up in the keystone catalog.
# Defaults to $::os_service_default
#
# [*username*]
# (optional) Username
# Defaults to 'nova'
#
# [*password*]
# (optional) User's password
# Only required if auth_type has been set to "password"
# Defaults to undef
#
# === DEPRECATED PARAMETERS
#
# [*nova_catalog_info*]
# (optional) Info to match when looking for nova in the service
# catalog. Format is : separated values of the form:
# catalog. Format is: separated values of the form
# <service_type>:<service_name>:<endpoint_type>
# Defaults to 'compute:nova:publicURL'
# Defaults to undef
#
# [*nova_catalog_admin_info*]
# (optional) Same as nova_catalog_info, but for admin endpoint.
# Defaults to 'compute:nova:adminURL'
#
# [*nova_ca_certificates_file*]
# (optional) Location of ca certificates file to use for nova client
# requests.
# (optional) Same as nova_catalog_info, but for admin endpoint
# Defaults to undef
#
# [*nova_api_insecure*]
# (optional) Allow to perform insecure SSL requests to nova.
# Defaults to false
# Allow to perform insecure SSL requests to nova
# Defaults to undef
#
# [*nova_ca_certificates_file*]
# (optional) Location of CA certificates file to use for nova client requests
# (string value)
# Defaults to undef
#
# [*nova_admin_username*]
# (optional) Nova admin username.
# Defaults to 'nova'
# (optional) Nova admin username
# Defaults to undef
#
# [*nova_admin_password*]
# (optional) Nova admin password.
# (optional) Nova admin password
# Defaults to undef
#
# [*nova_admin_tenant_name*]
# (optional) Nova admin tenant name.
# Defaults to 'service'
# (optional) Nova admin tenant name
# Defaults to undef
#
# [*nova_admin_auth_url*]
# (optional) Identity service url.
# Defaults to 'http://localhost:5000/v2.0'
# (optional) Identity service url
# Defaults to undef
#
class manila::compute::nova (
$nova_catalog_info = 'compute:nova:publicURL',
$nova_catalog_admin_info = 'compute:nova:adminURL',
$insecure = $::os_service_default,
$auth_url = $::os_service_default,
$auth_type = $::os_service_default,
$cafile = $::os_service_default,
$user_domain_name = 'Default',
$project_domain_name = 'Default',
$project_name = 'service',
$region_name = $::os_service_default,
$endpoint_type = $::os_service_default,
$username = 'nova',
$password = undef,
# DEPRECATED PARAMETERS
$nova_catalog_info = undef,
$nova_catalog_admin_info = undef,
$nova_api_insecure = undef,
$nova_ca_certificates_file = undef,
$nova_api_insecure = false,
$nova_admin_username = 'nova',
$nova_admin_username = undef,
$nova_admin_password = undef,
$nova_admin_tenant_name = 'service',
$nova_admin_auth_url = 'http://localhost:5000/v2.0',
$nova_admin_tenant_name = undef,
$nova_admin_auth_url = undef,
) {
include ::manila::deps
if $nova_catalog_info {
warning('The nova_catalog_info parameter is deprecated, has no effect and will be removed in a future release.')
}
if $nova_catalog_admin_info {
warning('The nova_catalog_admin_info parameter is deprecated, has no effect and will be removed in a future release.')
}
if $nova_api_insecure {
warning('The nova_api_insecure parameter is deprecated, use insecure instead.')
}
if $nova_ca_certificates_file {
warning('The nova_ca_certificates_file parameter is deprecated, use cafile instead.')
}
if $nova_admin_username {
warning('The nova_admin_username parameter is deprecated, use username instead.')
}
if $nova_admin_password {
warning('The nova_admin_password parameter is deprecated, use password instead.')
}
if $nova_admin_tenant_name {
warning('The nova_admin_tenant_name parameter is deprecated, use project_name instead.')
}
if $nova_admin_auth_url {
warning('The nova_admin_auth_url parameter is deprecated, use auth_url instead.')
}
$insecure_real = pick($nova_api_insecure, $insecure)
$cafile_real = pick($nova_ca_certificates_file, $cafile)
$username_real = pick($nova_admin_username, $username)
$password_real = pick_default($nova_admin_password, $password)
$project_name_real = pick($nova_admin_tenant_name, $project_name)
$auth_url_real = pick($nova_admin_auth_url, $auth_url)
manila_config {
'DEFAULT/nova_catalog_info': value => $nova_catalog_info;
'DEFAULT/nova_catalog_admin_info': value => $nova_catalog_admin_info;
'DEFAULT/nova_ca_certificates_file': value => $nova_ca_certificates_file;
'DEFAULT/nova_api_insecure': value => $nova_api_insecure;
'DEFAULT/nova_admin_username': value => $nova_admin_username;
'DEFAULT/nova_admin_password': value => $nova_admin_password, secret => true;
'DEFAULT/nova_admin_tenant_name': value => $nova_admin_tenant_name;
'DEFAULT/nova_admin_auth_url': value => $nova_admin_auth_url;
'nova/insecure': value => $insecure_real;
'nova/auth_url': value => $auth_url_real;
'nova/auth_type': value => $auth_type;
'nova/cafile': value => $cafile_real;
'nova/region_name': value => $region_name;
'nova/endpoint_type': value => $endpoint_type;
}
if $auth_type == 'password' {
manila_config {
'nova/username': value => $username_real;
'nova/user_domain_name': value => $user_domain_name;
'nova/password': value => $password_real, secret => true;
'nova/project_name': value => $project_name_real;
'nova/project_domain_name': value => $project_domain_name;
}
}
}

View File

@ -1,78 +1,210 @@
# == class: manila::network::neutron
# == Class: manila::network::neutron
#
# Setup and configure Neutron communication
#
# === Parameters
#
# [*neutron_url*]
# (optional) URL for connecting to neutron
# [*insecure*]
# (optional) Verify HTTPS connections
# Defaults to $::os_service_default
#
# [*neutron_url_timeout*]
# (optional) timeout value for connecting to neutron in seconds
# [*auth_url*]
# (optional) Authentication URL
# Defaults to $::os_service_default
#
# [*neutron_admin_username*]
# (optional) username for connecting to neutron in admin context
# [*auth_type*]
# (optional) Authentication type to load
# Defaults to $::os_service_default
#
# [*neutron_admin_password*]
# (optional) password for connecting to neutron in admin context
# [*cafile*]
# (optional) PEM encoded Certificate Authority to use when verifying HTTPS
# connections.
# Defaults to $::os_service_default
#
# [*neutron_admin_tenant_name*]
# (optional) Tenant name for connecting to neutron in admin context
# [*user_domain_name*]
# (optional) User's domain name
# Defaults to 'Default'
#
# [*neutron_region_name*]
# (optional) region name for connecting to neutron in admin context
# [*project_domain_name*]
# (optional) Domain name containing project
# Defaults to 'Default'
#
# [*neutron_admin_auth_url*]
# (optional) auth url for connecting to neutron in admin context
# [*project_name*]
# (optional) Project name to scope to
# Defaults to 'service'
#
# [*neutron_api_insecure*]
# (optional) if set, ignore any SSL validation issues
# [*region_name*]
# (optional) Region name for connecting to neutron
# Defaults to $::os_service_default
#
# [*neutron_auth_strategy*]
# (optional) auth strategy for connecting to
# neutron in admin context
# [*timeout*]
# (optional) Timeout value for http requests
# Defaults to $::os_service_default
#
# [*neutron_ca_certificates_file*]
# (optional) Location of ca certificates file to use for
# neutron client requests.
# [*endpoint_type*]
# (optional) The type of neutron endpoint to use when
# looking up in the keystone catalog.
# Defaults to $::os_service_default
#
# [*username*]
# (optional) Username
# Defaults to 'neutron'
#
# [*password*]
# (optional) User's password
# Defaults to undef
#
# [*network_plugin_ipv4_enabled*]
# (optional) Whether to support Ipv4 network resource
# (optional) Whether to support Ipv4 network resource
# Defaults to $::os_service_default
#
# [*network_plugin_ipv6_enabled*]
# (optional) whether to support IPv6 network resource
# (optional) whether to support IPv6 network resource
# Defaults to $::os_service_default
#
# === DEPRECATED PARAMETERS
#
# [*neutron_api_insecure*]
# (optional) if set, ignore any SSL validation issues
# Defaults to undef
#
# [*neutron_ca_certificates_file*]
# (optional) Location of ca certificates file to use for
# neutron client requests.
# Defaults to undef
#
# [*neutron_url*]
# (optional) URL for connecting to neutron
# Defaults to undef
#
# [*neutron_url_timeout*]
# (optional) timeout value for connecting to neutron in seconds
# Defaults to undef
#
# [*neutron_admin_username*]
# (optional) username for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_password*]
# (optional) password for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_tenant_name*]
# (optional) Tenant name for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_region_name*]
# (optional) region name for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_admin_auth_url*]
# (optional) auth url for connecting to neutron in admin context
# Defaults to undef
#
# [*neutron_auth_strategy*]
# (optional) auth strategy for connecting to
# neutron in admin context.
# Defaults to undef
#
class manila::network::neutron (
$neutron_url = 'http://127.0.0.1:9696',
$neutron_url_timeout = 30,
$neutron_admin_username = 'neutron',
$neutron_admin_password = undef,
$neutron_admin_tenant_name = 'service',
$neutron_region_name = undef,
$neutron_admin_auth_url = 'http://localhost:5000/v2.0',
$neutron_api_insecure = false,
$neutron_auth_strategy = 'keystone',
$neutron_ca_certificates_file = undef,
$insecure = $::os_service_default,
$auth_url = $::os_service_default,
$auth_type = $::os_service_default,
$cafile = $::os_service_default,
$user_domain_name = 'Default',
$project_domain_name = 'Default',
$project_name = 'service',
$region_name = $::os_service_default,
$timeout = $::os_service_default,
$endpoint_type = $::os_service_default,
$username = 'neutron',
$password = undef,
$network_plugin_ipv4_enabled = $::os_service_default,
$network_plugin_ipv6_enabled = $::os_service_default,
# DEPRECATED PARAMETERS
$neutron_api_insecure = undef,
$neutron_ca_certificates_file = undef,
$neutron_url = undef,
$neutron_url_timeout = undef,
$neutron_admin_username = undef,
$neutron_admin_password = undef,
$neutron_admin_tenant_name = undef,
$neutron_region_name = undef,
$neutron_admin_auth_url = undef,
$neutron_auth_strategy = undef,
) {
if $neutron_api_insecure {
warning('The neutron_api_insecure parameter is deprecated, use insecure instead.')
}
if $neutron_ca_certificates_file {
warning('The neutron_ca_certificates_file parameter is deprecated, use cafile instead.')
}
if $neutron_url {
warning('The neutron_url parameter is deprecated, has no effect and will be removed in a future release.')
}
if $neutron_url_timeout {
warning('The neutron_url_timeout parameter is deprecated, use timeout instead.')
}
if $neutron_admin_username {
warning('The neutron_admin_username parameter is deprecated, use username instead.')
}
if $neutron_admin_password {
warning('The neutron_admin_password parameter is deprecated, use password instead.')
}
if $neutron_admin_tenant_name {
warning('The neutron_admin_tenant_name parameter is deprecated, use project_name instead.')
}
if $neutron_region_name {
warning('The neutron_region_name parameter is deprecated, use region_name instead.')
}
if $neutron_admin_auth_url {
warning('The neutron_admin_auth_url parameter is deprecated, use auth_url instead.')
}
if $neutron_auth_strategy {
warning('The neutron_url parameter is deprecated, has no effect and will be removed in a future release.')
}
$insecure_real = pick($neutron_api_insecure, $insecure)
$auth_url_real = pick($neutron_admin_auth_url, $auth_url)
$cafile_real = pick($neutron_ca_certificates_file, $cafile)
$project_name_real = pick($neutron_admin_tenant_name, $project_name)
$region_name_real = pick($neutron_region_name, $region_name)
$timeout_real = pick($neutron_url_timeout, $timeout)
$username_real = pick($neutron_admin_username, $username)
$password_real = pick_default($neutron_admin_password, $password)
$neutron_plugin_name = 'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin'
manila_config {
'DEFAULT/network_api_class': value => $neutron_plugin_name;
'DEFAULT/neutron_url': value => $neutron_url;
'DEFAULT/neutron_url_timeout': value => $neutron_url_timeout;
'DEFAULT/neutron_admin_username': value => $neutron_admin_username;
'DEFAULT/neutron_admin_password': value => $neutron_admin_password, secret => true;
'DEFAULT/neutron_admin_tenant_name': value => $neutron_admin_tenant_name;
'DEFAULT/neutron_region_name': value => $neutron_region_name;
'DEFAULT/neutron_admin_auth_url': value => $neutron_admin_auth_url;
'DEFAULT/neutron_api_insecure': value => $neutron_api_insecure;
'DEFAULT/neutron_auth_strategy': value => $neutron_auth_strategy;
'DEFAULT/neutron_ca_certificates_file': value => $neutron_ca_certificates_file;
'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled;
'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled;
'DEFAULT/network_api_class': value => $neutron_plugin_name;
'neutron/insecure': value => $insecure_real;
'neutron/auth_url': value => $auth_url_real;
'neutron/auth_type': value => $auth_type;
'neutron/cafile': value => $cafile_real;
'neutron/region_name': value => $region_name_real;
'neutron/timeout': value => $timeout_real;
'neutron/endpoint_type': value => $endpoint_type;
'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled;
'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled;
}
if $auth_type == 'password' {
manila_config {
'neutron/username': value => $username_real;
'neutron/user_domain_name': value => $user_domain_name;
'neutron/password': value => $password_real, secret => true;
'neutron/project_name': value => $project_name_real;
'neutron/project_domain_name': value => $project_domain_name;
}
}
}

View File

@ -0,0 +1,14 @@
---
upgrade:
- |
Keystone v2 has been oficially deprecated. Add new configuration options
for nova and neutron to be used with keystone v3.
deprecations:
- |
Deprecate nova_catalog_info, nova_catalog_admin_info, nova_api_insecure,
nova_ca_certificates_file, nova_admin_username, nova_admin_password,
nova_admin_tenant_name and nova_admin_auth_url from nova section in manila.conf.
Deprecate neutron_api_insecure, neutron_ca_certificates_file, neutron_url,
neutron_url_timeout, neutron_admin_username, neutron_admin_password,
neutron_admin_tenant_name, neutron_region_name, neutron_admin_auth_url and
neutron_auth_strategy from neutron section in manila.conf.

View File

@ -1,43 +1,73 @@
require 'spec_helper'
describe 'manila::compute::nova' do
shared_examples 'manila-nova' do
shared_examples 'manila::nova' do
context 'with default parameters' do
it 'configures manila compute nova' do
is_expected.to contain_manila_config('DEFAULT/nova_catalog_info').with_value('compute:nova:publicURL')
is_expected.to contain_manila_config('DEFAULT/nova_catalog_admin_info').with_value('compute:nova:adminURL')
is_expected.to contain_manila_config('DEFAULT/nova_api_insecure').with_value(false)
is_expected.to contain_manila_config('DEFAULT/nova_admin_username').with_value('nova')
is_expected.to contain_manila_config('DEFAULT/nova_admin_tenant_name').with_value('service')
is_expected.to contain_manila_config('DEFAULT/nova_admin_auth_url').with_value('http://localhost:5000/v2.0')
is_expected.to contain_manila_config('nova/insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('nova/auth_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('nova/auth_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('nova/cafile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('nova/region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('nova/endpoint_type').with_value('<SERVICE DEFAULT>')
# These should be added only when auth_type is 'password'
is_expected.not_to contain_manila_config('nova/user_domain_name')
is_expected.not_to contain_manila_config('nova/project_domain_name')
is_expected.not_to contain_manila_config('nova/project_name')
is_expected.not_to contain_manila_config('nova/username')
is_expected.not_to contain_manila_config('nova/password')
end
end
context 'with overridden parameters' do
let :params do
{
:nova_catalog_info => 'compute:nova:internalURL',
:nova_catalog_admin_info => 'compute:nova:publicURL',
:nova_ca_certificates_file => '/etc/ca.cert',
:nova_api_insecure => true,
:nova_admin_username => 'novav1',
:nova_admin_password => '123123',
:nova_admin_tenant_name => 'services',
:nova_admin_auth_url => 'http://localhost:5000/v3',
:insecure => true,
:auth_url => 'http://127.0.0.2:5000/',
:auth_type => 'password',
:cafile => '/etc/ssl/certs/ca.crt',
:region_name => 'RegionOne',
:endpoint_type => 'publicURL',
:username => 'novav1',
:password => '123123',
}
end
it 'configures manila nova' do
is_expected.to contain_manila_config('DEFAULT/nova_catalog_info').with_value('compute:nova:internalURL')
is_expected.to contain_manila_config('DEFAULT/nova_catalog_admin_info').with_value('compute:nova:publicURL')
is_expected.to contain_manila_config('DEFAULT/nova_ca_certificates_file').with_value('/etc/ca.cert')
is_expected.to contain_manila_config('DEFAULT/nova_api_insecure').with_value(true)
is_expected.to contain_manila_config('DEFAULT/nova_admin_username').with_value('novav1')
is_expected.to contain_manila_config('DEFAULT/nova_admin_tenant_name').with_value('services')
is_expected.to contain_manila_config('DEFAULT/nova_admin_password').with_value('123123').with_secret(true)
is_expected.to contain_manila_config('DEFAULT/nova_admin_auth_url').with_value('http://localhost:5000/v3')
it 'configures manila nova with overridden parameters' do
is_expected.to contain_manila_config('nova/insecure').with_value(true)
is_expected.to contain_manila_config('nova/auth_url').with_value('http://127.0.0.2:5000/')
is_expected.to contain_manila_config('nova/auth_type').with_value('password')
is_expected.to contain_manila_config('nova/cafile').with_value('/etc/ssl/certs/ca.crt')
is_expected.to contain_manila_config('nova/user_domain_name').with_value('Default')
is_expected.to contain_manila_config('nova/project_domain_name').with_value('Default')
is_expected.to contain_manila_config('nova/project_name').with_value('service')
is_expected.to contain_manila_config('nova/region_name').with_value('RegionOne')
is_expected.to contain_manila_config('nova/endpoint_type').with_value('publicURL')
is_expected.to contain_manila_config('nova/username').with_value('novav1')
is_expected.to contain_manila_config('nova/password').with_value('123123').with_secret(true)
end
end
context 'with deprecated parameters' do
let :params do
{
:nova_api_insecure => true,
:nova_ca_certificates_file => '/foo/ssl/certs/ca.crt',
:auth_type => 'password',
:nova_admin_tenant_name => 'service2',
:nova_admin_username => 'novav2',
:nova_admin_password => '321321',
}
end
it 'configures manila compute nova with deprecated parameters' do
is_expected.to contain_manila_config('nova/auth_type').with_value('password')
is_expected.to contain_manila_config('nova/insecure').with_value(true)
is_expected.to contain_manila_config('nova/cafile').with_value('/foo/ssl/certs/ca.crt')
is_expected.to contain_manila_config('nova/project_name').with_value('service2')
is_expected.to contain_manila_config('nova/username').with_value('novav2')
is_expected.to contain_manila_config('nova/password').with_value('321321')
end
end
end
@ -50,7 +80,7 @@ describe 'manila::compute::nova' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'manila-nova'
it_behaves_like 'manila::nova'
end
end
end

View File

@ -1,48 +1,89 @@
require 'spec_helper'
describe 'manila::network::neutron' do
shared_examples 'manila::neutron' do
context 'with default parameters' do
it 'configures manila network neutron' do
is_expected.to contain_manila_config('neutron/insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/auth_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/auth_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/cafile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutron/endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv4_enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv6_enabled').with_value('<SERVICE DEFAULT>')
let :params do
{
:neutron_admin_username => 'neutron',
:neutron_admin_password => 'password',
:neutron_admin_tenant_name => 'service',
:neutron_region_name => 'nova',
:neutron_ca_certificates_file => '/etc/neutron/ca-certificates',
}
end
let :default_params do
{
:neutron_url => 'http://127.0.0.1:9696',
:neutron_url_timeout => 30,
:neutron_admin_tenant_name => 'service',
:neutron_admin_auth_url => 'http://localhost:5000/v2.0',
:neutron_api_insecure => false,
:neutron_auth_strategy => 'keystone',
:network_plugin_ipv4_enabled => '<SERVICE DEFAULT>',
:network_plugin_ipv6_enabled => '<SERVICE DEFAULT>',
}
end
shared_examples_for 'neutron network plugin' do
let :params_hash do
default_params.merge(params)
# These should be added only when auth_type is 'password'
is_expected.not_to contain_manila_config('neutron/user_domain_name')
is_expected.not_to contain_manila_config('neutron/project_domain_name')
is_expected.not_to contain_manila_config('neutron/project_name')
is_expected.not_to contain_manila_config('neutron/username')
is_expected.not_to contain_manila_config('neutron/password')
end
end
it 'configures neutron network plugin' do
context 'with overridden parameters' do
let :params do
{
:insecure => true,
:auth_url => 'http://127.0.0.2:5000/',
:auth_type => 'password',
:cafile => '/etc/ssl/certs/ca.crt',
:region_name => 'RegionOne',
:timeout => 30,
:endpoint_type => 'publicURL',
:username => 'neutronv1',
:password => '123123',
:network_plugin_ipv4_enabled => false,
:network_plugin_ipv6_enabled => true,
}
end
is_expected.to contain_manila_config("DEFAULT/network_api_class").with_value(
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
it 'configures manila neutron with overridden parameters' do
is_expected.to contain_manila_config('DEFAULT/network_api_class').with_value('manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
is_expected.to contain_manila_config('neutron/insecure').with_value(true)
is_expected.to contain_manila_config('neutron/auth_url').with_value('http://127.0.0.2:5000/')
is_expected.to contain_manila_config('neutron/auth_type').with_value('password')
is_expected.to contain_manila_config('neutron/cafile').with_value('/etc/ssl/certs/ca.crt')
is_expected.to contain_manila_config('neutron/user_domain_name').with_value('Default')
is_expected.to contain_manila_config('neutron/project_domain_name').with_value('Default')
is_expected.to contain_manila_config('neutron/project_name').with_value('service')
is_expected.to contain_manila_config('neutron/region_name').with_value('RegionOne')
is_expected.to contain_manila_config('neutron/timeout').with_value(30)
is_expected.to contain_manila_config('neutron/endpoint_type').with_value('publicURL')
is_expected.to contain_manila_config('neutron/username').with_value('neutronv1')
is_expected.to contain_manila_config('neutron/password').with_value('123123').with_secret(true)
is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv4_enabled').with_value(false)
is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv6_enabled').with_value(true)
end
end
params_hash.each_pair do |config,value|
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
context 'with deprecated parameters' do
let :params do
{
:auth_type => 'password',
:neutron_api_insecure => true,
:neutron_ca_certificates_file => '/foo/ssl/certs/ca.crt',
:neutron_admin_tenant_name => 'service2',
:neutron_admin_username => 'neutronv2',
:neutron_admin_password => '321321',
:neutron_url_timeout => 30,
}
end
it 'configures manila compute nova with deprecated parameters' do
is_expected.to contain_manila_config('neutron/auth_type').with_value('password')
is_expected.to contain_manila_config('neutron/insecure').with_value(true)
is_expected.to contain_manila_config('neutron/cafile').with_value('/foo/ssl/certs/ca.crt')
is_expected.to contain_manila_config('neutron/project_name').with_value('service2')
is_expected.to contain_manila_config('neutron/username').with_value('neutronv2')
is_expected.to contain_manila_config('neutron/password').with_value('321321')
is_expected.to contain_manila_config('neutron/timeout').with_value(30)
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
@ -50,17 +91,8 @@ describe 'manila::network::neutron' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
end
context 'with default parameters' do
before do
params = {}
end
it_configures 'neutron network plugin'
end
context 'with provided parameters' do
it_configures 'neutron network plugin'
end
it_behaves_like 'manila::neutron'
end
end
end