Add keepalivd vrrp parameters

Change-Id: I26ad5d41239b6e770e975dc6f78fc46a87803220
This commit is contained in:
Carlos Goncalves 2019-10-11 10:16:03 +02:00
parent 952e448d8f
commit 8fd7b2e0ff
3 changed files with 82 additions and 25 deletions

View File

@ -127,6 +127,30 @@
# This includes all kernel, system, and security logs.
# Defaults to $::os_service_default
#
# [*vrrp_advert_int*]
# (optional) Amphora role and priority advertisement internal in seconds.
# Defaults to $::os_service_default
#
# [*vrrp_check_interval*]
# (optional) VRRP health check script run interval in seconds.
# Defaults to $::os_service_default
#
# [*vrrp_fail_count*]
# (optional) Number of successive failures before transition to a fail rate.
# Defaults to $::os_service_default
#
# [*vrrp_success_count*]
# (optional) Number of consecutive successes before transition to a success rate.
# Defaults to $::os_service_default
#
# [*vrrp_garp_refresh_interval*]
# (optional) Time in seconds between gratuitous ARP announcements from the MASTER.
# Defaults to $::os_service_default
#
# [*vrrp_garp_refresh_count*]
# (optional) Number of gratuitous ARP announcements to make on each refresh interval.
# Defaults to $::os_service_default
#
class octavia::controller (
$amp_flavor_id = '65',
$amp_image_tag = $::os_service_default,
@ -155,6 +179,12 @@ class octavia::controller (
$user_log_facility = $::os_service_default,
$user_log_format = $::os_service_default,
$disable_local_log_storage = $::os_service_default,
$vrrp_advert_int = $::os_service_default,
$vrrp_check_interval = $::os_service_default,
$vrrp_fail_count = $::os_service_default,
$vrrp_success_count = $::os_service_default,
$vrrp_garp_refresh_interval = $::os_service_default,
$vrrp_garp_refresh_count = $::os_service_default,
) inherits octavia::params {
include ::octavia::deps
@ -189,30 +219,36 @@ class octavia::controller (
}
octavia_config {
'controller_worker/amp_flavor_id' : value => $amp_flavor_id_real;
'controller_worker/amp_image_tag' : value => $amp_image_tag_real;
'controller_worker/amp_secgroup_list' : value => $amp_secgroup_list_real;
'controller_worker/amp_boot_network_list' : value => $amp_boot_network_list_real;
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology_real;
'controller_worker/amphora_driver' : value => $amphora_driver_real;
'controller_worker/compute_driver' : value => $compute_driver_real;
'controller_worker/network_driver' : value => $network_driver_real;
'haproxy_amphora/timeout_client_data' : value => $timeout_client_data_real;
'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect_real;
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data_real;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect_real;
'health_manager/controller_ip_port_list' : value => $controller_ip_port_list;
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
'haproxy_amphora/connection_logging' : value => $connection_logging;
'haproxy_amphora/build_active_retries' : value => $build_active_retries;
'networking/port_detach_timeout' : value => $port_detach_timeout;
'amphora_agent/admin_log_targets' : value => $admin_log_targets;
'amphora_agent/administrative_log_facility' : value => $administrative_log_facility;
'amphora_agent/forward_all_logs' : value => $forward_all_logs;
'amphora_agent/tenant_log_targets' : value => $tenant_log_targets;
'amphora_agent/user_log_facility' : value => $user_log_facility;
'haproxy_amphora/user_log_format' : value => $user_log_format;
'amphora_agent/disable_local_log_storage' : value => $disable_local_log_storage;
'controller_worker/amp_flavor_id' : value => $amp_flavor_id_real;
'controller_worker/amp_image_tag' : value => $amp_image_tag_real;
'controller_worker/amp_secgroup_list' : value => $amp_secgroup_list_real;
'controller_worker/amp_boot_network_list' : value => $amp_boot_network_list_real;
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology_real;
'controller_worker/amphora_driver' : value => $amphora_driver_real;
'controller_worker/compute_driver' : value => $compute_driver_real;
'controller_worker/network_driver' : value => $network_driver_real;
'haproxy_amphora/timeout_client_data' : value => $timeout_client_data_real;
'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect_real;
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data_real;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect_real;
'health_manager/controller_ip_port_list' : value => $controller_ip_port_list;
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
'haproxy_amphora/connection_logging' : value => $connection_logging;
'haproxy_amphora/build_active_retries' : value => $build_active_retries;
'networking/port_detach_timeout' : value => $port_detach_timeout;
'amphora_agent/admin_log_targets' : value => $admin_log_targets;
'amphora_agent/administrative_log_facility' : value => $administrative_log_facility;
'amphora_agent/forward_all_logs' : value => $forward_all_logs;
'amphora_agent/tenant_log_targets' : value => $tenant_log_targets;
'amphora_agent/user_log_facility' : value => $user_log_facility;
'haproxy_amphora/user_log_format' : value => $user_log_format;
'amphora_agent/disable_local_log_storage' : value => $disable_local_log_storage;
'keepalived_vrrp/vrrp_advert_int' : value => $vrrp_advert_int;
'keepalived_vrrp/vrrp_check_interval' : value => $vrrp_check_interval;
'keepalived_vrrp/vrrp_fail_count' : value => $vrrp_fail_count;
'keepalived_vrrp/vrrp_success_count' : value => $vrrp_success_count;
'keepalived_vrrp/vrrp_garp_refresh_interval' : value => $vrrp_garp_refresh_interval;
'keepalived_vrrp/vrrp_garp_refresh_count' : value => $vrrp_garp_refresh_count;
}
}

View File

@ -0,0 +1,3 @@
---
features:
- Added Keepalived VRRP parameters.

View File

@ -32,6 +32,12 @@ describe 'octavia::controller' do
:user_log_facility => 3,
:user_log_format => '{{ project_id }} {{ lb_id }}',
:disable_local_log_storage => true,
:vrrp_advert_int => 1,
:vrrp_check_interval => 5,
:vrrp_fail_count => 2,
:vrrp_success_count => 2,
:vrrp_garp_refresh_interval => 5,
:vrrp_garp_refresh_count => 2
}
end
@ -54,6 +60,12 @@ describe 'octavia::controller' do
it { is_expected.to contain_octavia_config('amphora_agent/user_log_facility').with_value(3) }
it { is_expected.to contain_octavia_config('haproxy_amphora/user_log_format').with_value('{{ project_id }} {{ lb_id }}') }
it { is_expected.to contain_octavia_config('amphora_agent/disable_local_log_storage').with_value(true) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_advert_int').with_value(1) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_check_interval').with_value(5) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_fail_count').with_value(2) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_success_count').with_value(2) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_interval').with_value(5) }
it { is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_count').with_value(2) }
end
it 'configures worker parameters' do
@ -78,6 +90,12 @@ describe 'octavia::controller' do
is_expected.to contain_octavia_config('amphora_agent/user_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/user_log_format').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('amphora_agent/disable_local_log_storage').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_advert_int').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_check_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_fail_count').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_success_count').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_count').with_value('<SERVICE DEFAULT>')
end
context 'with ssh key access disabled' do