
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
57 lines
1.3 KiB
Puppet
57 lines
1.3 KiB
Puppet
# == Class: manila::share
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*package_ensure*]
|
|
# (Optional) Ensure State for package
|
|
# Defaults to 'present'.
|
|
#
|
|
# [*enabled*]
|
|
# (Optional) Should the service be enabled
|
|
# Defaults to true.
|
|
#
|
|
# [*manage_service*]
|
|
# (Optional) Whether the service should be managed by Puppet
|
|
# Defaults to true.
|
|
#
|
|
# $share_name_template = share-%s
|
|
class manila::share (
|
|
$package_ensure = 'present',
|
|
$enabled = true,
|
|
$manage_service = true
|
|
) {
|
|
|
|
include ::manila::params
|
|
|
|
Manila_config<||> ~> Service['manila-share']
|
|
Manila_api_paste_ini<||> ~> Service['manila-share']
|
|
Exec<| title == 'manila-manage db_sync' |> ~> Service['manila-share']
|
|
|
|
if $::manila::params::share_package {
|
|
Package['manila'] -> Package['manila-share']
|
|
Package['manila-share'] -> Service['manila-share']
|
|
package { 'manila-share':
|
|
ensure => $package_ensure,
|
|
name => $::manila::params::share_package,
|
|
tag => ['openstack', 'manila-package'],
|
|
}
|
|
}
|
|
|
|
if $manage_service {
|
|
if $enabled {
|
|
$ensure = 'running'
|
|
} else {
|
|
$ensure = 'stopped'
|
|
}
|
|
}
|
|
|
|
service { 'manila-share':
|
|
ensure => $ensure,
|
|
name => $::manila::params::share_service,
|
|
enable => $enabled,
|
|
hasstatus => true,
|
|
require => Package['manila'],
|
|
tag => 'manila-service',
|
|
}
|
|
}
|