puppet-glance/manifests/init.pp
Dan Prince bce0eac01c Autorequire correct package based on the distro
Some distros (RHEL based) have a single glance package. On those
distros the ensure_package/autorequire stuff doesn't quite work
correctly as per the type code it is assumed two packages 'glance-api'
and 'glance-registry'

This commit makes sure that on RHEL based distros type only autorequire
'openstack-glance' while on other distros it correctly autorequire
'glance-api' and 'glance-registry'

Change-Id: I17c84b2282beadaec80f4db42fa5696b7967159f
Closes-bug: #1493442
Co-Authored-By: Yanis Guenane <yguenane@redhat.com>
2015-09-09 12:37:30 +02:00

35 lines
843 B
Puppet

# == class: glance
#
# base glance config.
#
# === parameters:
#
# [*package_ensure*]
# (Optional) Ensure state for package. On Ubuntu this setting
# is ignored since Ubuntu has separate API and registry packages.
# Defaults to 'present'
#
class glance(
$package_ensure = 'present'
) {
include ::glance::params
file { '/etc/glance/':
ensure => directory,
owner => 'glance',
group => 'root',
mode => '0770',
}
if ( $glance::params::api_package_name == $glance::params::registry_package_name ) {
package { $::glance::params::api_package_name :
ensure => $package_ensure,
name => $::glance::params::api_package_name,
tag => ['openstack', 'glance-package'],
}
}
ensure_resource('package', 'python-openstackclient', {'ensure' => $package_ensure, tag => 'openstack'})
}