Merge "Do not define service resource when service management is disabled"
This commit is contained in:
commit
abc8b1ff74
@ -31,39 +31,36 @@ class zaqar::server(
|
|||||||
include zaqar::params
|
include zaqar::params
|
||||||
include zaqar::policy
|
include zaqar::policy
|
||||||
|
|
||||||
if $enabled {
|
if $manage_service {
|
||||||
if $manage_service {
|
if $enabled {
|
||||||
$ensure = 'running'
|
$ensure = 'running'
|
||||||
}
|
} else {
|
||||||
} else {
|
|
||||||
if $manage_service {
|
|
||||||
$ensure = 'stopped'
|
$ensure = 'stopped'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if $service_name == $::zaqar::params::service_name {
|
if $service_name == $::zaqar::params::service_name {
|
||||||
service { $::zaqar::params::service_name:
|
service { $::zaqar::params::service_name:
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
name => $::zaqar::params::service_name,
|
name => $::zaqar::params::service_name,
|
||||||
enable => $enabled,
|
enable => $enabled,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
tag => 'zaqar-service',
|
tag => 'zaqar-service',
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif $service_name == 'httpd' {
|
} elsif $service_name == 'httpd' {
|
||||||
service { $::zaqar::params::service_name:
|
service { $::zaqar::params::service_name:
|
||||||
ensure => 'stopped',
|
ensure => 'stopped',
|
||||||
name => $::zaqar::params::service_name,
|
name => $::zaqar::params::service_name,
|
||||||
enable => false,
|
enable => false,
|
||||||
tag => ['zaqar-service'],
|
tag => ['zaqar-service'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# we need to make sure zaqar-server is stopped before trying to start apache
|
# we need to make sure zaqar-server is stopped before trying to start apache
|
||||||
Service[$::zaqar::params::service_name] -> Service[$service_name]
|
Service[$::zaqar::params::service_name] -> Service[$service_name]
|
||||||
Service <| title == 'httpd' |> { tag +> 'zaqar-service' }
|
Service <| title == 'httpd' |> { tag +> 'zaqar-service' }
|
||||||
} else {
|
} else {
|
||||||
fail("Invalid service_name. Either zaqar-server/openstack-zaqar for \
|
fail("Invalid service_name. Either zaqar-server/openstack-zaqar for \
|
||||||
running as a standalone service, or httpd for being run by a httpd server")
|
running as a standalone service, or httpd for being run by a httpd server")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user