Add amp_secgroup_list configuration parameter

In order for Octavia to setup the correct security groups for new
amphorae, it needs to know which security groups to attach.

This patch adds the option of allowing to setup those security
groups if they need to be customized.

Change-Id: I765740583dda2b54d930825f2f10f8130b5f4e9d
This commit is contained in:
Mohammed Naser 2017-07-25 16:12:53 -04:00
parent 81f615457c
commit 1e8980f28b
No known key found for this signature in database
GPG Key ID: 481CBC90384AEC42
3 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,10 @@
# be updated without requiring reconfiguration of Octavia.
# Defaults to $::os_service_default
#
# [*amp_secgroup_list*]
# List of security groups to use for Amphorae.
# Defaults to $::os_service_default
#
# [*amp_boot_network_list*]
# List of networks to attach to Amphorae.
# Defaults to []
@ -65,6 +69,7 @@ class octavia::worker (
$package_ensure = 'present',
$amp_flavor_id = '65',
$amp_image_tag = $::os_service_default,
$amp_secgroup_list = $::os_service_default,
$amp_boot_network_list = [],
$loadbalancer_topology = $::os_service_default,
$manage_nova_flavor = true,
@ -130,6 +135,7 @@ class octavia::worker (
octavia_config {
'controller_worker/amp_flavor_id' : value => $amp_flavor_id;
'controller_worker/amp_image_tag' : value => $amp_image_tag;
'controller_worker/amp_secgroup_list' : value => $amp_secgroup_list;
'controller_worker/amp_boot_network_list' : value => $amp_boot_network_list;
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology;
'controller_worker/amphora_driver' : value => $amphora_driver;

View File

@ -0,0 +1,4 @@
---
features:
- support for configuring amp_secgroup_list has been added which allows to
configure the security groups to be setup on the amphorae

View File

@ -29,6 +29,7 @@ describe 'octavia::worker' do
params.merge!({
:amp_flavor_id => '42',
:amp_image_tag => 'amphorae1',
:amp_secgroup_list => ['lb-mgmt-sec-grp'],
:amp_boot_network_list => ['lbnet1', 'lbnet2'],
:loadbalancer_topology => 'SINGLE',
})
@ -36,6 +37,7 @@ describe 'octavia::worker' do
it { is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('42') }
it { is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('amphorae1') }
it { is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value(['lb-mgmt-sec-grp']) }
it { is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value(['lbnet1', 'lbnet2']) }
it { is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('SINGLE') }
end