From 2850def15c39c2a71f636d5b65d22c873cbc1807 Mon Sep 17 00:00:00 2001 From: Fabian Zimmermann Date: Thu, 13 Oct 2016 11:33:20 +0200 Subject: [PATCH] Fix manage_service parameter Previously even if manage_service was set to false, we were always attempting to define the octavia-api service within puppet. This change updates the manage_service to control skipping the definition of the octavia-api service. Co-Authored-By: Alex Schultz Change-Id: I6d2729b3e22f4c434da098ea180a9d11cf73058b Closes-Bug: 1633001 --- manifests/api.pp | 18 +++++++++--------- .../api-manage-service-3a54c606e08ee623.yaml | 6 ++++++ spec/classes/octavia_api_spec.rb | 9 +-------- 3 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/api-manage-service-3a54c606e08ee623.yaml diff --git a/manifests/api.pp b/manifests/api.pp index 2cfe45c8..1bb379fa 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -60,21 +60,21 @@ class octavia::api ( } else { $service_ensure = 'stopped' } + + service { 'octavia-api': + ensure => $service_ensure, + name => $::octavia::params::api_service_name, + enable => $enabled, + hasstatus => true, + hasrestart => true, + tag => ['octavia-service', 'octavia-db-sync-service'], + } } if $sync_db { include ::octavia::db::sync } - service { 'octavia-api': - ensure => $service_ensure, - name => $::octavia::params::api_service_name, - enable => $enabled, - hasstatus => true, - hasrestart => true, - tag => ['octavia-service', 'octavia-db-sync-service'], - } - octavia_config { 'DEFAULT/host' : value => $host; 'DEFAULT/port' : value => $port; diff --git a/releasenotes/notes/api-manage-service-3a54c606e08ee623.yaml b/releasenotes/notes/api-manage-service-3a54c606e08ee623.yaml new file mode 100644 index 00000000..c09c6cc5 --- /dev/null +++ b/releasenotes/notes/api-manage-service-3a54c606e08ee623.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix the `manage_service` parameter for the api class. If `manage_service` + is set to false then the ocatavia-api service will not be defined in puppet + allowing the user to manage the service themselves or elsewhere. diff --git a/spec/classes/octavia_api_spec.rb b/spec/classes/octavia_api_spec.rb index 8f502c8c..45713e5e 100644 --- a/spec/classes/octavia_api_spec.rb +++ b/spec/classes/octavia_api_spec.rb @@ -91,14 +91,7 @@ describe 'octavia::api' do end it 'configures octavia-api service' do - is_expected.to contain_service('octavia-api').with( - :ensure => nil, - :name => platform_params[:api_service_name], - :enable => false, - :hasstatus => true, - :hasrestart => true, - :tag => ['octavia-service', 'octavia-db-sync-service'], - ) + is_expected.to_not contain_service('octavia-api') end end