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 <aschultz@redhat.com>
Change-Id: I6d2729b3e22f4c434da098ea180a9d11cf73058b
Closes-Bug: 1633001
This commit is contained in:
Fabian Zimmermann 2016-10-13 11:33:20 +02:00 committed by Alex Schultz
parent f8b2e9d1c1
commit 2850def15c
3 changed files with 16 additions and 17 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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