Browse Source

Merge "Do not declare service resources when manage_service is false"

changes/68/792568/1
Zuul 8 months ago
committed by Gerrit Code Review
parent
commit
9448a98907
  1. 16
      manifests/health_manager.pp
  2. 16
      manifests/housekeeping.pp
  3. 20
      manifests/worker.pp
  4. 11
      spec/classes/octavia_health_manager_spec.rb
  5. 11
      spec/classes/octavia_housekeeping_spec.rb
  6. 11
      spec/classes/octavia_worker_spec.rb

16
manifests/health_manager.pp

@ -68,15 +68,15 @@ class octavia::health_manager (
} else {
$service_ensure = 'stopped'
}
}
service { 'octavia-health-manager':
ensure => $service_ensure,
name => $::octavia::params::health_manager_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
service { 'octavia-health-manager':
ensure => $service_ensure,
name => $::octavia::params::health_manager_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
}
}
octavia_config {

16
manifests/housekeeping.pp

@ -77,15 +77,15 @@ class octavia::housekeeping (
} else {
$service_ensure = 'stopped'
}
}
service { 'octavia-housekeeping':
ensure => $service_ensure,
name => $::octavia::params::housekeeping_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
service { 'octavia-housekeeping':
ensure => $service_ensure,
name => $::octavia::params::housekeeping_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
}
}
octavia_config {

20
manifests/worker.pp

@ -86,7 +86,9 @@ class octavia::worker (
}
$nova_flavor_defaults = merge($octavia_flavor_defaults, $nova_flavor_config)
create_resources('nova_flavor', $octavia_flavor, $nova_flavor_defaults)
Nova_flavor<| tag == 'octavia' |> ~> Service['octavia-worker']
if $manage_service {
Nova_flavor<| tag == 'octavia' |> ~> Service['octavia-worker']
}
}
}
@ -102,15 +104,15 @@ class octavia::worker (
} else {
$service_ensure = 'stopped'
}
}
service { 'octavia-worker':
ensure => $service_ensure,
name => $::octavia::params::worker_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
service { 'octavia-worker':
ensure => $service_ensure,
name => $::octavia::params::worker_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => ['octavia-service'],
}
}
if $manage_keygen and ! $::octavia::controller::enable_ssh_access {

11
spec/classes/octavia_health_manager_spec.rb

@ -71,15 +71,8 @@ describe 'octavia::health_manager' do
:enabled => false })
end
it 'configures octavia-health-manager service' do
is_expected.to contain_service('octavia-health-manager').with(
:ensure => nil,
:name => platform_params[:health_manager_service_name],
:enable => false,
:hasstatus => true,
:hasrestart => true,
:tag => ['octavia-service'],
)
it 'does not configure octavia-health-manager service' do
is_expected.to_not contain_service('octavia-health-manager')
end
end

11
spec/classes/octavia_housekeeping_spec.rb

@ -77,15 +77,8 @@ describe 'octavia::housekeeping' do
:enabled => false })
end
it 'configures octavia-housekeeping service' do
is_expected.to contain_service('octavia-housekeeping').with(
:ensure => nil,
:name => platform_params[:housekeeping_service_name],
:enable => false,
:hasstatus => true,
:hasrestart => true,
:tag => ['octavia-service'],
)
it 'does not configure octavia-housekeeping service' do
is_expected.to_not contain_service('octavia-housekeeping')
end
end

11
spec/classes/octavia_worker_spec.rb

@ -116,15 +116,8 @@ describe 'octavia::worker' do
:enabled => false })
end
it 'configures octavia-worker service' do
is_expected.to contain_service('octavia-worker').with(
:ensure => nil,
:name => platform_params[:worker_service_name],
:enable => false,
:hasstatus => true,
:hasrestart => true,
:tag => ['octavia-service'],
)
it 'does not configure octavia-worker service' do
is_expected.to_not contain_service('octavia-worker')
end
end

Loading…
Cancel
Save