placement: Separate deployment from configuration
To allow for the deprecation and future removal of any Placement service deployment logic from puppet-nova this code first needs to be separated into its own class. Change-Id: Iadc2970afb65a6b3a1a3241147d042e6b04b0ad2
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# == Class: nova::placement
|
# == Class: nova::placement
|
||||||
#
|
#
|
||||||
# Class for configuring [placement] section in nova.conf.
|
# Class for deploying Placement and configuring the [placement] section in nova.conf.
|
||||||
#
|
#
|
||||||
# === Parameters:
|
# === Parameters:
|
||||||
#
|
#
|
||||||
@@ -98,26 +98,17 @@ class nova::placement(
|
|||||||
|
|
||||||
include ::nova::deps
|
include ::nova::deps
|
||||||
|
|
||||||
validate_bool($enabled)
|
|
||||||
|
|
||||||
if $os_interface {
|
if $os_interface {
|
||||||
warning('nova::placement::os_interface is deprecated for removal, please use valid_interfaces instead.')
|
warning('nova::placement::os_interface is deprecated for removal, please use valid_interfaces instead.')
|
||||||
}
|
}
|
||||||
$valid_interfaces_real = pick($os_interface, $valid_interfaces)
|
$valid_interfaces_real = pick($os_interface, $valid_interfaces)
|
||||||
|
|
||||||
if $service_name == 'nova-placement-api' {
|
class { '::nova::placement::service':
|
||||||
nova::generic_service { 'nova-placement-api':
|
enabled => $enabled,
|
||||||
enabled => $enabled,
|
manage_service => $manage_service,
|
||||||
manage_service => $manage_service,
|
package_name => $package_name,
|
||||||
package_name => $package_name,
|
service_name => $service_name,
|
||||||
service_name => $service_name,
|
ensure_package => $ensure_package,
|
||||||
ensure_package => $ensure_package,
|
|
||||||
}
|
|
||||||
} elsif $service_name == 'httpd' {
|
|
||||||
# we need to make sure nova-placement-api/uwsgi is stopped before trying to start apache
|
|
||||||
if ($::os_package_type == 'debian') {
|
|
||||||
Service['nova-placement-api'] -> Service[$service_name]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nova_config {
|
nova_config {
|
||||||
|
57
manifests/placement/service.pp
Normal file
57
manifests/placement/service.pp
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# == Class: nova::placement::service
|
||||||
|
#
|
||||||
|
# Class for deploying the Placement service.
|
||||||
|
#
|
||||||
|
# === Parameters:
|
||||||
|
#
|
||||||
|
# [*enabled*]
|
||||||
|
# (optional) Whether the nova placement api service will be run
|
||||||
|
# Defaults to true
|
||||||
|
#
|
||||||
|
# [*manage_service*]
|
||||||
|
# (optional) Whether to start/stop the service
|
||||||
|
# Only useful if $::nova::params::service_name is set to
|
||||||
|
# nova-placement-api.
|
||||||
|
# Defaults to true
|
||||||
|
#
|
||||||
|
# [*package_name*]
|
||||||
|
# (optional) The package name for nova placement.
|
||||||
|
# Defaults to $::nova::params::placement_package_name
|
||||||
|
#
|
||||||
|
# [*service_name*]
|
||||||
|
# (optional) The service name for the placement service.
|
||||||
|
# Defaults to $::nova::params::placement_service_name
|
||||||
|
#
|
||||||
|
# [*ensure_package*]
|
||||||
|
# (optional) The state of the nova placement package
|
||||||
|
# Defaults to 'present'
|
||||||
|
#
|
||||||
|
class nova::placement::service(
|
||||||
|
$enabled = true,
|
||||||
|
$manage_service = true,
|
||||||
|
$package_name = $::nova::params::placement_package_name,
|
||||||
|
$service_name = $::nova::params::placement_service_name,
|
||||||
|
$ensure_package = 'present',
|
||||||
|
) inherits nova::params {
|
||||||
|
|
||||||
|
include ::nova::deps
|
||||||
|
|
||||||
|
assert_private()
|
||||||
|
|
||||||
|
validate_bool($enabled)
|
||||||
|
|
||||||
|
if $service_name == 'nova-placement-api' {
|
||||||
|
nova::generic_service { 'nova-placement-api':
|
||||||
|
enabled => $enabled,
|
||||||
|
manage_service => $manage_service,
|
||||||
|
package_name => $package_name,
|
||||||
|
service_name => $service_name,
|
||||||
|
ensure_package => $ensure_package,
|
||||||
|
}
|
||||||
|
} elsif $service_name == 'httpd' {
|
||||||
|
# we need to make sure nova-placement-api/uwsgi is stopped before trying to start apache
|
||||||
|
if ($::os_package_type == 'debian') {
|
||||||
|
Service['nova-placement-api'] -> Service[$service_name]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user