From 59cd4d406667f92ed4d6669c4686f7f3afe45efd Mon Sep 17 00:00:00 2001 From: Eugene Dementiev Date: Thu, 13 Aug 2015 15:11:59 +0300 Subject: [PATCH] Fixed package prefix for CentOS 5 --- manifests/plugin.pp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e48f9a54..92abd7d9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,12 +17,21 @@ # define yum::plugin ( $ensure = present, - $pkg_prefix = 'yum-plugin', + $pkg_prefix = undef, $pkg_name = '' ) { + + if $pkg_prefix { + $_pkg_prefix = $pkg_prefix + } else { + $_pkg_prefix = "${::operatingsystem}${::operatingsystemmajrelease}" ? { + 'CentOS5' => 'yum', + default => 'yum-plugin' + } + } $_pkg_name = $pkg_name ? { - '' => "${pkg_prefix}-${name}", - default => "${pkg_prefix}-${pkg_name}" + '' => "${_pkg_prefix}-${name}", + default => "${_pkg_prefix}-${pkg_name}" } package { $_pkg_name: