Refactor class magnum::clients
To make a better support of OpenStack clients' configuration in Magnum, this patch splits the original magnum::clients into services related classes and make it compatible with the old version. Change-Id: I2eb25717fd07833264f1e3b9919b59f917312427
This commit is contained in:
parent
85e63ad069
commit
73210b5516
@ -14,32 +14,37 @@
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
#
|
||||
# [*ca_file*]
|
||||
# (optional) CA cert file to use in SSL connections.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*cert_file*]
|
||||
# (optional) PEM-formatted certificate chain file.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) PEM-formatted file that contains the private key.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*insecure*]
|
||||
# (optional) If set, then the server's certificate will not be verified.
|
||||
# Defaults to false
|
||||
#
|
||||
class magnum::clients (
|
||||
$region_name = 'RegionOne',
|
||||
$endpoint_type = 'publicURL',
|
||||
$ca_file = $::os_service_default,
|
||||
$cert_file = $::os_service_default,
|
||||
$key_file = $::os_service_default,
|
||||
$insecure = false
|
||||
) {
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'cinder_client/region_name': value => $region_name;
|
||||
'barbican_client/region_name': value => $region_name;
|
||||
'glance_client/region_name': value => $region_name;
|
||||
'heat_client/region_name': value => $region_name;
|
||||
'magnum_client/region_name': value => $region_name;
|
||||
'neutron_client/region_name': value => $region_name;
|
||||
'nova_client/region_name': value => $region_name;
|
||||
}
|
||||
|
||||
magnum_config {
|
||||
'barbican_client/endpoint_type': value => $endpoint_type;
|
||||
'glance_client/endpoint_type': value => $endpoint_type;
|
||||
'heat_client/endpoint_type': value => $endpoint_type;
|
||||
'magnum_client/endpoint_type': value => $endpoint_type;
|
||||
'neutron_client/endpoint_type': value => $endpoint_type;
|
||||
'nova_client/endpoint_type': value => $endpoint_type;
|
||||
}
|
||||
|
||||
|
||||
include ::magnum::clients::barbican
|
||||
include ::magnum::clients::cinder
|
||||
include ::magnum::clients::glance
|
||||
include ::magnum::clients::heat
|
||||
include ::magnum::clients::magnum
|
||||
include ::magnum::clients::neutron
|
||||
include ::magnum::clients::nova
|
||||
}
|
||||
|
29
manifests/clients/barbican.pp
Normal file
29
manifests/clients/barbican.pp
Normal file
@ -0,0 +1,29 @@
|
||||
# == Class: magnum::clients::barbican
|
||||
#
|
||||
# Manages barbican clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
|
||||
class magnum::clients::barbican(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'barbican_client/region_name': value => $region_name;
|
||||
'barbican_client/endpoint_type': value => $endpoint_type;
|
||||
}
|
||||
}
|
22
manifests/clients/cinder.pp
Normal file
22
manifests/clients/cinder.pp
Normal file
@ -0,0 +1,22 @@
|
||||
# == Class: magnum::clients::cinder
|
||||
#
|
||||
# Manages cinder clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
class magnum::clients::cinder(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'cinder_client/region_name': value => $region_name;
|
||||
}
|
||||
}
|
60
manifests/clients/glance.pp
Normal file
60
manifests/clients/glance.pp
Normal file
@ -0,0 +1,60 @@
|
||||
# == Class: magnum::clients::glance
|
||||
#
|
||||
# Manages glance clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
#
|
||||
# [*api_version*]
|
||||
# (optional) Version of Glance API to use in glanceclient.
|
||||
# Defaults to 2
|
||||
#
|
||||
# [*ca_file*]
|
||||
# (optional) CA cert file to use in SSL connections.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*cert_file*]
|
||||
# (optional) PEM-formatted certificate chain file.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) PEM-formatted file that contains the private key.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*insecure*]
|
||||
# (optional) If set, then the server's certificate will not be verified.
|
||||
# Defaults to false
|
||||
#
|
||||
|
||||
class magnum::clients::glance(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
$api_version = '2',
|
||||
$ca_file = $magnum::clients::ca_file,
|
||||
$cert_file = $magnum::clients::cert_file,
|
||||
$key_file = $magnum::clients::key_file,
|
||||
$insecure = $magnum::clients::insecure
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'glance_client/region_name': value => $region_name;
|
||||
'glance_client/endpoint_type': value => $endpoint_type;
|
||||
'glance_client/api_version': value => $api_version;
|
||||
'glance_client/ca_file': value => $ca_file;
|
||||
'glance_client/cert_file': value => $cert_file;
|
||||
'glance_client/key_file': value => $key_file;
|
||||
'glance_client/insecure': value => $insecure;
|
||||
}
|
||||
}
|
60
manifests/clients/heat.pp
Normal file
60
manifests/clients/heat.pp
Normal file
@ -0,0 +1,60 @@
|
||||
# == Class: magnum::clients::heat
|
||||
#
|
||||
# Manages heat clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
#
|
||||
# [*api_version*]
|
||||
# (optional) Version of heat API to use in heatclient.
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*ca_file*]
|
||||
# (optional) CA cert file to use in SSL connections.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*cert_file*]
|
||||
# (optional) PEM-formatted certificate chain file.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) PEM-formatted file that contains the private key.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*insecure*]
|
||||
# (optional) If set, then the server's certificate will not be verified.
|
||||
# Defaults to false
|
||||
#
|
||||
|
||||
class magnum::clients::heat(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
$api_version = '1',
|
||||
$ca_file = $magnum::clients::ca_file,
|
||||
$cert_file = $magnum::clients::cert_file,
|
||||
$key_file = $magnum::clients::key_file,
|
||||
$insecure = $magnum::clients::insecure
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'heat_client/region_name': value => $region_name;
|
||||
'heat_client/endpoint_type': value => $endpoint_type;
|
||||
'heat_client/api_version': value => $api_version;
|
||||
'heat_client/ca_file': value => $ca_file;
|
||||
'heat_client/cert_file': value => $cert_file;
|
||||
'heat_client/key_file': value => $key_file;
|
||||
'heat_client/insecure': value => $insecure;
|
||||
}
|
||||
}
|
29
manifests/clients/magnum.pp
Normal file
29
manifests/clients/magnum.pp
Normal file
@ -0,0 +1,29 @@
|
||||
# == Class: magnum::clients::magnum
|
||||
#
|
||||
# Manages magnum clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
|
||||
class magnum::clients::magnum(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'magnum_client/region_name': value => $region_name;
|
||||
'magnum_client/endpoint_type': value => $endpoint_type;
|
||||
}
|
||||
}
|
53
manifests/clients/neutron.pp
Normal file
53
manifests/clients/neutron.pp
Normal file
@ -0,0 +1,53 @@
|
||||
# == Class: magnum::clients::neutron
|
||||
#
|
||||
# Manages neutron clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
#
|
||||
# [*ca_file*]
|
||||
# (optional) CA cert file to use in SSL connections.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*cert_file*]
|
||||
# (optional) PEM-formatted certificate chain file.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) PEM-formatted file that contains the private key.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*insecure*]
|
||||
# (optional) If set, then the server's certificate will not be verified.
|
||||
# Defaults to false
|
||||
#
|
||||
class magnum::clients::neutron(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
$ca_file = $magnum::clients::ca_file,
|
||||
$cert_file = $magnum::clients::cert_file,
|
||||
$key_file = $magnum::clients::key_file,
|
||||
$insecure = $magnum::clients::insecure
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'neutron_client/region_name': value => $region_name;
|
||||
'neutron_client/endpoint_type': value => $endpoint_type;
|
||||
'neutron_client/ca_file': value => $ca_file;
|
||||
'neutron_client/cert_file': value => $cert_file;
|
||||
'neutron_client/key_file': value => $key_file;
|
||||
'neutron_client/insecure': value => $insecure;
|
||||
}
|
||||
}
|
60
manifests/clients/nova.pp
Normal file
60
manifests/clients/nova.pp
Normal file
@ -0,0 +1,60 @@
|
||||
# == Class: magnum::clients::nova
|
||||
#
|
||||
# Manages nova clients configuration in magnum server
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) Region in Identity service catalog to use for communication
|
||||
# with the OpenStack service.
|
||||
# Defaults to RegionOne
|
||||
#
|
||||
# [*endpoint_type*]
|
||||
# (optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with the the OpenStack service.
|
||||
# Defaults to publicURL
|
||||
#
|
||||
# [*api_version*]
|
||||
# (optional) Version of nova API to use in novaclient.
|
||||
# Defaults to 2
|
||||
#
|
||||
# [*ca_file*]
|
||||
# (optional) CA cert file to use in SSL connections.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*cert_file*]
|
||||
# (optional) PEM-formatted certificate chain file.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) PEM-formatted file that contains the private key.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*insecure*]
|
||||
# (optional) If set, then the server's certificate will not be verified.
|
||||
# Defaults to false
|
||||
#
|
||||
|
||||
class magnum::clients::nova(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clietns::endpoint_type,
|
||||
$api_version = '2',
|
||||
$ca_file = $magnum::clients::ca_file,
|
||||
$cert_file = $magnum::clients::cert_file,
|
||||
$key_file = $magnum::clients::key_file,
|
||||
$insecure = $magnum::clients::insecure
|
||||
){
|
||||
|
||||
include ::magnum::deps
|
||||
include ::magnum::params
|
||||
|
||||
magnum_config {
|
||||
'nova_client/region_name': value => $region_name;
|
||||
'nova_client/endpoint_type': value => $endpoint_type;
|
||||
'nova_client/api_version': value => $api_version;
|
||||
'nova_client/ca_file': value => $ca_file;
|
||||
'nova_client/cert_file': value => $cert_file;
|
||||
'nova_client/key_file': value => $key_file;
|
||||
'nova_client/insecure': value => $insecure;
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Original magnum::clients has been splited into serveral sub class for related OpenStack services.
|
41
spec/classes/magnum_clients_barbican_spec.rb
Normal file
41
spec/classes/magnum_clients_barbican_spec.rb
Normal file
@ -0,0 +1,41 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::barbican' do
|
||||
|
||||
shared_examples 'magnum::clients::barbican' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('publicURL') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('adminURL') }
|
||||
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_configures 'magnum::clients::barbican'
|
||||
end
|
||||
end
|
||||
end
|
37
spec/classes/magnum_clients_cinder_spec.rb
Normal file
37
spec/classes/magnum_clients_cinder_spec.rb
Normal file
@ -0,0 +1,37 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::cinder' do
|
||||
|
||||
shared_examples 'magnum::clients::cinder' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('cinder_client/region_name').with_value('RegionOne') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('cinder_client/region_name').with_value('RegionTwo') }
|
||||
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_configures 'magnum::clients::cinder'
|
||||
end
|
||||
end
|
||||
end
|
59
spec/classes/magnum_clients_glance_spec.rb
Normal file
59
spec/classes/magnum_clients_glance_spec.rb
Normal file
@ -0,0 +1,59 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::glance' do
|
||||
|
||||
shared_examples 'magnum::clients::glance' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
:ca_file => '<SERVICE DEFAULT>',
|
||||
:cert_file => '<SERVICE DEFAULT>',
|
||||
:key_file => '<SERVICE DEFAULT>',
|
||||
:insecure => false,
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('glance_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/ca_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/cert_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/key_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/insecure').with_value(false) }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
:ca_file => '/etc/magnum/certs/ca.pem',
|
||||
:cert_file => '/etc/magnum/certs/cert.pem',
|
||||
:key_file => '/etc/magnum/certs/pri.key',
|
||||
:insecure => true,
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('glance_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/ca_file').with_value('/etc/magnum/certs/ca.pem') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/cert_file').with_value('/etc/magnum/certs/cert.pem') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/key_file').with_value('/etc/magnum/certs/pri.key') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/insecure').with_value(true) }
|
||||
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_configures 'magnum::clients::glance'
|
||||
end
|
||||
end
|
||||
end
|
41
spec/classes/magnum_clients_heat_spec.rb
Normal file
41
spec/classes/magnum_clients_heat_spec.rb
Normal file
@ -0,0 +1,41 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::barbican' do
|
||||
|
||||
shared_examples 'magnum::clients::barbican' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('publicURL') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('adminURL') }
|
||||
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_configures 'magnum::clients::barbican'
|
||||
end
|
||||
end
|
||||
end
|
41
spec/classes/magnum_clients_magnum_spec.rb
Normal file
41
spec/classes/magnum_clients_magnum_spec.rb
Normal file
@ -0,0 +1,41 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::magnum' do
|
||||
|
||||
shared_examples 'magnum::clients::magnum' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('magnum_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/endpoint_type').with_value('publicURL') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('magnum_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/endpoint_type').with_value('adminURL') }
|
||||
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_configures 'magnum::clients::magnum'
|
||||
end
|
||||
end
|
||||
end
|
58
spec/classes/magnum_clients_neutron_spec.rb
Normal file
58
spec/classes/magnum_clients_neutron_spec.rb
Normal file
@ -0,0 +1,58 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::neutron' do
|
||||
|
||||
shared_examples 'magnum::clients::neutron' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
:ca_file => '<SERVICE DEFAULT>',
|
||||
:cert_file => '<SERVICE DEFAULT>',
|
||||
:key_file => '<SERVICE DEFAULT>',
|
||||
:insecure => false
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/ca_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/cert_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/key_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/insecure').with_value(false) }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
:ca_file => '/etc/magnum/certs/ca.pem',
|
||||
:cert_file => '/etc/magnum/certs/cert.pem',
|
||||
:key_file => '/etc/magnum/certs/pri.key',
|
||||
:insecure => true,
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/ca_file').with_value('/etc/magnum/certs/ca.pem') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/cert_file').with_value('/etc/magnum/certs/cert.pem') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/key_file').with_value('/etc/magnum/certs/pri.key') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/insecure').with_value(true) }
|
||||
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_configures 'magnum::clients::neutron'
|
||||
end
|
||||
end
|
||||
end
|
60
spec/classes/magnum_clients_nova_spec.rb
Normal file
60
spec/classes/magnum_clients_nova_spec.rb
Normal file
@ -0,0 +1,60 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::nova' do
|
||||
|
||||
shared_examples 'magnum::clients::nova' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionOne',
|
||||
:endpoint_type => 'publicURL',
|
||||
:ca_file => '<SERVICE DEFAULT>',
|
||||
:cert_file => '<SERVICE DEFAULT>',
|
||||
:key_file => '<SERVICE DEFAULT>',
|
||||
:insecure => false,
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('nova_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/ca_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/cert_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/key_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/insecure').with_value(false) }
|
||||
it { is_expected.to contain_magnum_config('nova_client/api_version').with_value(2) }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
:ca_file => '/etc/magnum/certs/ca.pem',
|
||||
:cert_file => '/etc/magnum/certs/cert.pem',
|
||||
:key_file => '/etc/magnum/certs/pri.key',
|
||||
:insecure => true,
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('nova_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/ca_file').with_value('/etc/magnum/certs/ca.pem') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/cert_file').with_value('/etc/magnum/certs/cert.pem') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/key_file').with_value('/etc/magnum/certs/pri.key') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/insecure').with_value(true) }
|
||||
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_configures 'magnum::clients::nova'
|
||||
end
|
||||
end
|
||||
end
|
@ -3,42 +3,17 @@ require 'spec_helper'
|
||||
describe 'magnum::clients' do
|
||||
|
||||
shared_examples 'magnum::clients' do
|
||||
context 'with default parameters' do
|
||||
it { is_expected.to contain_magnum_config('cinder_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('heat_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('heat_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/endpoint_type').with_value('publicURL') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :region_name => 'RegionTwo',
|
||||
:endpoint_type => 'adminURL',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('cinder_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('heat_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('barbican_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('glance_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('heat_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('magnum_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('nova_client/endpoint_type').with_value('adminURL') }
|
||||
it 'contains following classes' do
|
||||
is_expected.to contain_class('magnum::deps')
|
||||
is_expected.to contain_class('magnum::params')
|
||||
is_expected.to contain_class('magnum::clients::barbican')
|
||||
is_expected.to contain_class('magnum::clients::cinder')
|
||||
is_expected.to contain_class('magnum::clients::glance')
|
||||
is_expected.to contain_class('magnum::clients::heat')
|
||||
is_expected.to contain_class('magnum::clients::nova')
|
||||
is_expected.to contain_class('magnum::clients::magnum')
|
||||
is_expected.to contain_class('magnum::clients::neutron')
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user