Skip to content

Commit

Permalink
check for $::osfamily and fail() on unsupported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Nov 14, 2012
1 parent da86c3c commit 975840e
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,34 @@
$gmetad_package_name = 'ganglia-gmetad'
$gmetad_service_name = 'gmetad'

case $lsbmajdistrelease {
# the epel packages change uid/gids + install paths between 5 & 6
5: {
$ganglia_uid = 298
$ganglia_gid = 298
$gmond_service_config = '/etc/gmond.conf'
$gmond_service_erb = 'ganglia/gmond.conf.el5.erb'
case $::osfamily {
redhat: {
case $::lsbmajdistrelease {
# the epel packages change uid/gids + install paths between 5 & 6
5: {
$ganglia_uid = 298
$ganglia_gid = 298
$gmond_service_config = '/etc/gmond.conf'
$gmond_service_erb = 'ganglia/gmond.conf.el5.erb'

$gmetad_service_config = '/etc/gmetad.conf'
$gmetad_service_erb = 'ganglia/gmetad.conf.el5.erb'
}
6: {
$ganglia_uid = 211
$ganglia_gid = 211
$gmond_service_config = '/etc/ganglia/gmond.conf'
$gmond_service_erb = 'ganglia/gmond.conf.el6.erb'
$gmetad_service_config = '/etc/gmetad.conf'
$gmetad_service_erb = 'ganglia/gmetad.conf.el5.erb'
}
# fedora is also part of $::osfamily = redhat so we shouldn't default
# to failing on el7.x +
6, default: {
$ganglia_uid = 211
$ganglia_gid = 211
$gmond_service_config = '/etc/ganglia/gmond.conf'
$gmond_service_erb = 'ganglia/gmond.conf.el6.erb'

$gmetad_service_config = '/etc/ganglia/gmetad.conf'
$gmetad_service_erb = 'ganglia/gmetad.conf.el6.erb'
$gmetad_service_config = '/etc/ganglia/gmetad.conf'
$gmetad_service_erb = 'ganglia/gmetad.conf.el6.erb'
}
}
}
default: {
fail("Module ${module_name} is not supported on ${::operatingsystem}")
}
}
}

0 comments on commit 975840e

Please sign in to comment.