Do not declare service resources when manage_service is false
This change ensures that service resources are not declared when manage_service is false, to fix rspec-puppet 2.7.1 support. Change-Id: I86e05c5182842b73d413ddc95f797c1da5fd0ac2
This commit is contained in:
parent
6fba0ace08
commit
a7b46e1ef6
@ -68,15 +68,15 @@ class octavia::health_manager (
|
|||||||
} else {
|
} else {
|
||||||
$service_ensure = 'stopped'
|
$service_ensure = 'stopped'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
service { 'octavia-health-manager':
|
service { 'octavia-health-manager':
|
||||||
ensure => $service_ensure,
|
ensure => $service_ensure,
|
||||||
name => $::octavia::params::health_manager_service_name,
|
name => $::octavia::params::health_manager_service_name,
|
||||||
enable => $enabled,
|
enable => $enabled,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
tag => ['octavia-service'],
|
tag => ['octavia-service'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
octavia_config {
|
octavia_config {
|
||||||
|
@ -77,15 +77,15 @@ class octavia::housekeeping (
|
|||||||
} else {
|
} else {
|
||||||
$service_ensure = 'stopped'
|
$service_ensure = 'stopped'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
service { 'octavia-housekeeping':
|
service { 'octavia-housekeeping':
|
||||||
ensure => $service_ensure,
|
ensure => $service_ensure,
|
||||||
name => $::octavia::params::housekeeping_service_name,
|
name => $::octavia::params::housekeeping_service_name,
|
||||||
enable => $enabled,
|
enable => $enabled,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
tag => ['octavia-service'],
|
tag => ['octavia-service'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
octavia_config {
|
octavia_config {
|
||||||
|
@ -86,7 +86,9 @@ class octavia::worker (
|
|||||||
}
|
}
|
||||||
$nova_flavor_defaults = merge($octavia_flavor_defaults, $nova_flavor_config)
|
$nova_flavor_defaults = merge($octavia_flavor_defaults, $nova_flavor_config)
|
||||||
create_resources('nova_flavor', $octavia_flavor, $nova_flavor_defaults)
|
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 {
|
} else {
|
||||||
$service_ensure = 'stopped'
|
$service_ensure = 'stopped'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
service { 'octavia-worker':
|
service { 'octavia-worker':
|
||||||
ensure => $service_ensure,
|
ensure => $service_ensure,
|
||||||
name => $::octavia::params::worker_service_name,
|
name => $::octavia::params::worker_service_name,
|
||||||
enable => $enabled,
|
enable => $enabled,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
tag => ['octavia-service'],
|
tag => ['octavia-service'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $manage_keygen and ! $::octavia::controller::enable_ssh_access {
|
if $manage_keygen and ! $::octavia::controller::enable_ssh_access {
|
||||||
|
@ -71,15 +71,8 @@ describe 'octavia::health_manager' do
|
|||||||
:enabled => false })
|
:enabled => false })
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures octavia-health-manager service' do
|
it 'does not configure octavia-health-manager service' do
|
||||||
is_expected.to contain_service('octavia-health-manager').with(
|
is_expected.to_not contain_service('octavia-health-manager')
|
||||||
:ensure => nil,
|
|
||||||
:name => platform_params[:health_manager_service_name],
|
|
||||||
:enable => false,
|
|
||||||
:hasstatus => true,
|
|
||||||
:hasrestart => true,
|
|
||||||
:tag => ['octavia-service'],
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,15 +77,8 @@ describe 'octavia::housekeeping' do
|
|||||||
:enabled => false })
|
:enabled => false })
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures octavia-housekeeping service' do
|
it 'does not configure octavia-housekeeping service' do
|
||||||
is_expected.to contain_service('octavia-housekeeping').with(
|
is_expected.to_not contain_service('octavia-housekeeping')
|
||||||
:ensure => nil,
|
|
||||||
:name => platform_params[:housekeeping_service_name],
|
|
||||||
:enable => false,
|
|
||||||
:hasstatus => true,
|
|
||||||
:hasrestart => true,
|
|
||||||
:tag => ['octavia-service'],
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -116,15 +116,8 @@ describe 'octavia::worker' do
|
|||||||
:enabled => false })
|
:enabled => false })
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures octavia-worker service' do
|
it 'does not configure octavia-worker service' do
|
||||||
is_expected.to contain_service('octavia-worker').with(
|
is_expected.to_not contain_service('octavia-worker')
|
||||||
:ensure => nil,
|
|
||||||
:name => platform_params[:worker_service_name],
|
|
||||||
:enable => false,
|
|
||||||
:hasstatus => true,
|
|
||||||
:hasrestart => true,
|
|
||||||
:tag => ['octavia-service'],
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user