From 7896b5649367bafd19bde747603dd94d6f9db331 Mon Sep 17 00:00:00 2001 From: Matthew J Black Date: Fri, 20 May 2016 14:09:00 -0400 Subject: [PATCH] Install lbaas driver with lbaas service class. Typically if someone installed the agent as part of neutron::server it would satisfy the dependency of installing python-neutron-lbaas but if someone chooses to not install the agent as part of the neutron::server class but still wants to use lbaas then they will need to have the python-neutron-lbaas package installed. Change-Id: I936e2177d00b57036f63b283af52f3009078d6bc --- manifests/services/lbaas.pp | 16 ++++++++++++++-- ...to_lbaas_services_class-8d0f51e7be9b5f42.yaml | 5 +++++ spec/classes/neutron_services_lbaas_spec.rb | 4 ++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add_lbaas_driver_package_to_lbaas_services_class-8d0f51e7be9b5f42.yaml diff --git a/manifests/services/lbaas.pp b/manifests/services/lbaas.pp index 67b8bef1c..8e9e3d915 100644 --- a/manifests/services/lbaas.pp +++ b/manifests/services/lbaas.pp @@ -22,6 +22,10 @@ # # === Parameters: # +# [*ensure_lbaas_driver_package*] +# (optional) Whether to install the lbaas driver package +# Defaults to 'present' +# # [*service_providers*] # (optional) Array of allowed service types or ''. # Note: The default upstream value is empty. @@ -39,12 +43,20 @@ # Defaults to false # class neutron::services::lbaas ( - $package_ensure = false, - $service_providers = $::os_service_default, + $ensure_lbaas_driver_package = 'present', + $service_providers = $::os_service_default, + # DEPRECATED + $package_ensure = false, ) { include ::neutron::params + if $ensure_lbaas_driver_package { + ensure_packages(['python-neutron-lbaas'], { + ensure => $ensure_lbaas_driver_package, + tag => ['openstack', 'neutron-package'] + }) + } if $package_ensure { warning('Package ensure is deprecated. The neutron::agents::lbaas class should be used to install the agent') # agent package contains both agent and service resources diff --git a/releasenotes/notes/add_lbaas_driver_package_to_lbaas_services_class-8d0f51e7be9b5f42.yaml b/releasenotes/notes/add_lbaas_driver_package_to_lbaas_services_class-8d0f51e7be9b5f42.yaml new file mode 100644 index 000000000..5294a76cb --- /dev/null +++ b/releasenotes/notes/add_lbaas_driver_package_to_lbaas_services_class-8d0f51e7be9b5f42.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Added python-neutron-lbaas package to be installed with neutron::services::lbaas. + this removes a dependency of installing agent on neutron api server to enable + the lbaas service. diff --git a/spec/classes/neutron_services_lbaas_spec.rb b/spec/classes/neutron_services_lbaas_spec.rb index fdd3d980c..0840f45a4 100644 --- a/spec/classes/neutron_services_lbaas_spec.rb +++ b/spec/classes/neutron_services_lbaas_spec.rb @@ -32,6 +32,10 @@ describe 'neutron::services::lbaas' do let :params do default_params end + + it 'should contain python-neutron-lbaas package' do + is_expected.to contain_package('python-neutron-lbaas').with({ :ensure => 'present' }) + end end context 'with multiple service providers' do