diff --git a/manifests/services/vpnaas.pp b/manifests/services/vpnaas.pp index ca56b7279..08f466c38 100644 --- a/manifests/services/vpnaas.pp +++ b/manifests/services/vpnaas.pp @@ -11,6 +11,19 @@ # Must be in form: ::[:default] # Defaults to $facts['os_service_default'] # +# [*vpn_scheduler_driver*] +# (optional) Driver to use for scheduling router to a VPN agent. +# Defaults to $facts['os_service_default'] +# +# [*vpn_auto_schedule*] +# (optional) Allow auto scheduling of routers to VPN agent. +# Defaults to $facts['os_service_default'] +# +# [*allow_automatic_vpnagent_failover*] +# (optional) Automatically reschedule routers from offline VPN agents to +# online VPN agents. +# Defaults to $facts['os_service_default'] +# # [*sync_db*] # Whether 'neutron-db-manage' should run to create and/or synchronize the # database with neutron-vpnaas specific tables. @@ -22,10 +35,13 @@ # Defaults to false. # class neutron::services::vpnaas ( - $package_ensure = 'present', - $service_providers = $facts['os_service_default'], - Boolean $sync_db = false, - Boolean $purge_config = false, + $package_ensure = 'present', + $service_providers = $facts['os_service_default'], + $vpn_scheduler_driver = $facts['os_service_default'], + $vpn_auto_schedule = $facts['os_service_default'], + $allow_automatic_vpnagent_failover = $facts['os_service_default'], + Boolean $sync_db = false, + Boolean $purge_config = false, ) { include neutron::deps @@ -48,7 +64,10 @@ class neutron::services::vpnaas ( } neutron_vpnaas_service_config { - 'service_providers/service_provider': value => $service_providers_real; + 'service_providers/service_provider': value => $service_providers_real; + 'DEFAULT/vpn_scheduler_driver': value => $vpn_scheduler_driver; + 'DEFAULT/vpn_auto_schedule': value => $vpn_auto_schedule; + 'DEFAULT/allow_automatic_vpnagent_failover': value => $allow_automatic_vpnagent_failover; } if $sync_db { diff --git a/releasenotes/notes/vpnaas-scheduler-opts-9b65089e547db28e.yaml b/releasenotes/notes/vpnaas-scheduler-opts-9b65089e547db28e.yaml new file mode 100644 index 000000000..ba294f37e --- /dev/null +++ b/releasenotes/notes/vpnaas-scheduler-opts-9b65089e547db28e.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + The following parameters have been added to + the ``neutron::services::vpnaas`` class. + + - ``vpn_scheduler_driver`` + - ``vpn_auto_schedule`` + - ``allow_automatic_vpnagent_failover`` diff --git a/spec/classes/neutron_services_vpnaas_spec.rb b/spec/classes/neutron_services_vpnaas_spec.rb index 831fd9b0f..5431eb8c7 100644 --- a/spec/classes/neutron_services_vpnaas_spec.rb +++ b/spec/classes/neutron_services_vpnaas_spec.rb @@ -17,6 +17,9 @@ describe 'neutron::services::vpnaas' do ).with_value( 'VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default' ) + should contain_neutron_vpnaas_service_config('DEFAULT/vpn_scheduler_driver').with_value('') + should contain_neutron_vpnaas_service_config('DEFAULT/vpn_auto_schedule').with_value('') + should contain_neutron_vpnaas_service_config('DEFAULT/allow_automatic_vpnagent_failover').with_value('') end it 'does not run neutron-db-manage' do @@ -59,6 +62,24 @@ describe 'neutron::services::vpnaas' do ).with_value(['provider1', 'provider2']) end end + + context 'with parameters' do + let :params do + { + :vpn_scheduler_driver => 'neutron_vpnaas.scheduler.vpn_agent_scheduler.LeastRoutersScheduler', + :vpn_auto_schedule => true, + :allow_automatic_vpnagent_failover => false, + } + end + + it 'configures neutron_vpnaas.conf' do + should contain_neutron_vpnaas_service_config('DEFAULT/vpn_scheduler_driver').with_value( + 'neutron_vpnaas.scheduler.vpn_agent_scheduler.LeastRoutersScheduler' + ) + should contain_neutron_vpnaas_service_config('DEFAULT/vpn_auto_schedule').with_value(true) + should contain_neutron_vpnaas_service_config('DEFAULT/allow_automatic_vpnagent_failover').with_value(false) + end + end end on_supported_os({