Add support for [octavia_client] parameters
Change-Id: Id34a8b2a34f17c32a6d0f11537e0c6e1bac5ee88
This commit is contained in:
parent
1faacc8c68
commit
27b28f3826
@ -47,4 +47,5 @@ class magnum::clients (
|
||||
include magnum::clients::magnum
|
||||
include magnum::clients::neutron
|
||||
include magnum::clients::nova
|
||||
include magnum::clients::octavia
|
||||
}
|
||||
|
53
manifests/clients/octavia.pp
Normal file
53
manifests/clients/octavia.pp
Normal file
@ -0,0 +1,53 @@
|
||||
# == Class: magnum::clients::octavia
|
||||
#
|
||||
# Manages octavia 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 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::octavia(
|
||||
$region_name = $magnum::clients::region_name,
|
||||
$endpoint_type = $magnum::clients::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 {
|
||||
'octavia_client/region_name': value => $region_name;
|
||||
'octavia_client/endpoint_type': value => $endpoint_type;
|
||||
'octavia_client/ca_file': value => $ca_file;
|
||||
'octavia_client/cert_file': value => $cert_file;
|
||||
'octavia_client/key_file': value => $key_file;
|
||||
'octavia_client/insecure': value => $insecure;
|
||||
}
|
||||
}
|
4
releasenotes/notes/octavia_client-ae19dc0bde7981ac.yaml
Normal file
4
releasenotes/notes/octavia_client-ae19dc0bde7981ac.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``magnum::clients::octavia`` class has been added.
|
57
spec/classes/magnum_clients_octavia_spec.rb
Normal file
57
spec/classes/magnum_clients_octavia_spec.rb
Normal file
@ -0,0 +1,57 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::clients::octavia' do
|
||||
|
||||
shared_examples 'magnum::clients::octavia' 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('octavia_client/region_name').with_value('RegionOne') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/endpoint_type').with_value('publicURL') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/ca_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/cert_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/key_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('octavia_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('octavia_client/region_name').with_value('RegionTwo') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/endpoint_type').with_value('adminURL') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/ca_file').with_value('/etc/magnum/certs/ca.pem') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/cert_file').with_value('/etc/magnum/certs/cert.pem') }
|
||||
it { is_expected.to contain_magnum_config('octavia_client/key_file').with_value('/etc/magnum/certs/pri.key') }
|
||||
it { is_expected.to contain_magnum_config('octavia_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::octavia'
|
||||
end
|
||||
end
|
||||
end
|
@ -14,6 +14,7 @@ describe 'magnum::clients' do
|
||||
is_expected.to contain_class('magnum::clients::nova')
|
||||
is_expected.to contain_class('magnum::clients::magnum')
|
||||
is_expected.to contain_class('magnum::clients::neutron')
|
||||
is_expected.to contain_class('magnum::clients::octavia')
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user