
Currently we specify the ordering of config resources wherever it is necessary based on the presence of the file it will write to, or the presence of the package in charge of providing the file it will write to Those kind of ordering can be specified directly at the resource level using the autorequire mechanism. With this patch, any config resource will make sure the package in charge of providing the file will be installed first. Change-Id: Id40b1ccb705699876da23f0f7324c369ecbc71a5
68 lines
1.5 KiB
Puppet
68 lines
1.5 KiB
Puppet
# == Class: manila::scheduler
|
|
#
|
|
# Install and manage Manila scheduler.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*scheduler_driver*]
|
|
# (Optional) Description
|
|
# Defaults to false.
|
|
#
|
|
# [*package_ensure*]
|
|
# (Optional) The state of the scheduler package
|
|
# Defaults to 'present'.
|
|
#
|
|
# [*enabled*]
|
|
# (Optional) Whether to run the scheduler service
|
|
# Defaults to true.
|
|
#
|
|
# [*manage_service*]
|
|
# (Optional) Whether to start/stop the service
|
|
# Defaults to true.
|
|
#
|
|
class manila::scheduler (
|
|
$scheduler_driver = false,
|
|
$package_ensure = 'present',
|
|
$enabled = true,
|
|
$manage_service = true
|
|
) {
|
|
|
|
include ::manila::params
|
|
|
|
Manila_config<||> ~> Service['manila-scheduler']
|
|
Manila_api_paste_ini<||> ~> Service['manila-scheduler']
|
|
Exec<| title == 'manila-manage db_sync' |> ~> Service['manila-scheduler']
|
|
|
|
if $scheduler_driver {
|
|
manila_config {
|
|
'DEFAULT/scheduler_driver': value => $scheduler_driver;
|
|
}
|
|
}
|
|
|
|
if $::manila::params::scheduler_package {
|
|
Package['manila-scheduler'] -> Service['manila-scheduler']
|
|
package { 'manila-scheduler':
|
|
ensure => $package_ensure,
|
|
name => $::manila::params::scheduler_package,
|
|
tag => ['openstack', 'manila-package'],
|
|
}
|
|
}
|
|
|
|
if $manage_service {
|
|
if $enabled {
|
|
$ensure = 'running'
|
|
} else {
|
|
$ensure = 'stopped'
|
|
}
|
|
}
|
|
|
|
service { 'manila-scheduler':
|
|
ensure => $ensure,
|
|
name => $::manila::params::scheduler_service,
|
|
enable => $enabled,
|
|
hasstatus => true,
|
|
require => Package['manila'],
|
|
tag => 'manila-service',
|
|
}
|
|
}
|