Add amp_project_name to configure flavor access list
Adds support for adding the project being used by octavia to create amphora to the amphora flavor's access list. Change-Id: Iba14098d571f26e15c587b82271f00fd7cdc65d5
This commit is contained in:
parent
8626d27322
commit
3dc8602da6
@ -80,6 +80,10 @@
|
||||
# (optional) Whether or not create OpenStack keypair for communicating with amphora
|
||||
# Defaults to false
|
||||
#
|
||||
# [*amp_project_name*]
|
||||
# (optional) Set the project to be used for creating load balancer instances.
|
||||
# Defaults to undef
|
||||
#
|
||||
class octavia::worker (
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
@ -97,7 +101,8 @@ class octavia::worker (
|
||||
$amp_ssh_key_name = 'octavia-ssh-key',
|
||||
$enable_ssh_access = true,
|
||||
$key_path = '/etc/octavia/.ssh/octavia_ssh_key',
|
||||
$manage_keygen = false
|
||||
$manage_keygen = false,
|
||||
$amp_project_name = undef
|
||||
) inherits octavia::params {
|
||||
|
||||
include ::octavia::deps
|
||||
@ -116,7 +121,12 @@ class octavia::worker (
|
||||
}
|
||||
} else {
|
||||
if $manage_nova_flavor {
|
||||
$octavia_flavor = { "octavia_${amp_flavor_id}" => { 'id' => $amp_flavor_id } }
|
||||
$octavia_flavor = { "octavia_${amp_flavor_id}" =>
|
||||
{ 'id' => $amp_flavor_id,
|
||||
'project' => $amp_project_name
|
||||
}
|
||||
}
|
||||
|
||||
$octavia_flavor_defaults = {
|
||||
'ensure' => 'present',
|
||||
'ram' => '1024',
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Adds 'amp_project_name' to configure project access to the nova flavor for creating amphorae.
|
||||
|
@ -34,6 +34,12 @@ describe 'octavia::worker' do
|
||||
:loadbalancer_topology => 'SINGLE',
|
||||
:amp_ssh_key_name => 'custom-amphora-key',
|
||||
:key_path => '/opt/octavia/ssh/amphora_key',
|
||||
:amp_project_name => 'loadbalancers',
|
||||
:nova_flavor_config => {
|
||||
'ram' => '2048',
|
||||
'disk' => '3',
|
||||
'vcpus' => '4'
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@ -44,6 +50,18 @@ describe 'octavia::worker' do
|
||||
it { is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('SINGLE') }
|
||||
it { is_expected.to contain_octavia_config('controller_worker/amp_ssh_key_name').with_value('custom-amphora-key') }
|
||||
it { is_expected.to contain_octavia_config('haproxy_amphora/key_path').with_value('/opt/octavia/ssh/amphora_key') }
|
||||
it 'deploys a nova flavor for amphora' do
|
||||
is_expected.to contain_nova_flavor('octavia_42').with(
|
||||
:ensure => 'present',
|
||||
:id => '42',
|
||||
:ram => '2048',
|
||||
:disk => '3',
|
||||
:vcpus => '4',
|
||||
:is_public => false,
|
||||
:project => 'loadbalancers',
|
||||
:tag => ['octavia'],
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it 'configures worker parameters' do
|
||||
|
Loading…
Reference in New Issue
Block a user