system-config/modules/jeepyb/manifests/init.pp
Jeremy Stanley fecca12dee Install correct Python YAML package on CentOS/RH.
* modules/jeepyb/manifests/init.pp: Special-case the
Python YAML bindings package name depending on facter osfamily.

Change-Id: Iaa11e601e387428040a5d992219bd67812d8bac8
Reviewed-on: https://review.openstack.org/28652
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-05-09 03:55:55 +00:00

76 lines
1.6 KiB
Puppet

# == Class: jeepyb
#
class jeepyb (
$git_source_repo = 'https://github.com/openstack-infra/jeepyb.git',
) {
include mysql::python
if ! defined(Package['python-paramiko']) {
package { 'python-paramiko':
ensure => present,
}
}
if ! defined(Package['PyGithub']) {
package { 'PyGithub':
ensure => latest,
provider => pip,
require => Class['pip'],
}
}
if ! defined(Package['gerritlib']) {
package { 'gerritlib':
ensure => latest,
provider => pip,
require => Class['pip'],
}
}
if ! defined(Package['pkginfo']) {
package { 'pkginfo':
ensure => latest,
provider => pip,
require => Class['pip'],
}
}
# A lot of things need yaml, be conservative requiring this package to avoid
# conflicts with other modules.
case $::osfamily {
'Debian': {
if ! defined(Package['python-yaml']) {
package { 'python-yaml':
ensure => present,
}
}
}
'RedHat': {
if ! defined(Package['PyYAML']) {
package { 'PyYAML':
ensure => present,
}
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} The 'jeepyb' module only supports osfamily Debian or RedHat.")
}
}
vcsrepo { '/opt/jeepyb':
ensure => latest,
provider => git,
revision => 'master',
source => $git_source_repo,
}
exec { 'install_jeepyb' :
command => 'python setup.py install',
cwd => '/opt/jeepyb',
path => '/bin:/usr/bin',
refreshonly => true,
require => Class['mysql::python'],
subscribe => Vcsrepo['/opt/jeepyb'],
}
}