Clayton O'Neill 6c47d9f4bc Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins.  Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I6a4e08d91f8cc19eb1e59af03a2a7d14716ddc38
2015-02-21 12:09:04 +01:00

56 lines
1.3 KiB
Puppet

# == Class: cinder::volume
#
# === Parameters
#
# [*package_ensure*]
# (Optional) The state of the package.
# Defaults to 'present'.
#
# [*enabled*]
# (Optional) The state of the service
# Defaults to 'true'.
#
# [*manage_service*]
# (Optional) Whether to start/stop the service.
# Defaults to 'true'.
#
class cinder::volume (
$package_ensure = 'present',
$enabled = true,
$manage_service = true
) {
include ::cinder::params
Cinder_config<||> ~> Service['cinder-volume']
Cinder_api_paste_ini<||> ~> Service['cinder-volume']
Exec<| title == 'cinder-manage db_sync' |> ~> Service['cinder-volume']
if $::cinder::params::volume_package {
Package['cinder-volume'] -> Cinder_config<||>
Package['cinder-volume'] -> Cinder_api_paste_ini<||>
Package['cinder'] -> Package['cinder-volume']
Package['cinder-volume'] -> Service['cinder-volume']
package { 'cinder-volume':
ensure => $package_ensure,
name => $::cinder::params::volume_package,
}
}
if $manage_service {
if $enabled {
$ensure = 'running'
} else {
$ensure = 'stopped'
}
}
service { 'cinder-volume':
ensure => $ensure,
name => $::cinder::params::volume_service,
enable => $enabled,
hasstatus => true,
require => Package['cinder'],
}
}