Skip to content

Commit

Permalink
Reinstate the operatingsystem check.
Browse files Browse the repository at this point in the history
  • Loading branch information
pecastro committed Jul 31, 2014
1 parent 6cab5a5 commit afd6ec5
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,40 @@
class udev::params {
$udevadm_path = '/sbin'

case $::operatingsystem {
case $::osfamily {
'debian': {
$udev_package = 'udev'
$udevlogpriority = 'udevadm control --log-priority'
$udevtrigger = 'udevadm trigger'
}
'redhat': {
case $::operatingsystemmajrelease {
'5': {
$udev_package = 'udev'
$udevtrigger = 'udevtrigger'
$udevlogpriority = 'udevcontrol log_priority'
}
'6','7': {
$udev_package = 'udev'
if $::operatingsystem == 'Fedora' {
if ($::operatingsystemmajrelease >= 20) {
$udev_package = 'systemd'
$udevtrigger = 'udevadm trigger'
$udevlogpriority = 'udevadm control --log-priority'
}
default: {
fail("Module ${module_name} is not supported on RedHat release ${::operatingsystemmajrelease}")
else {
fail("Module ${module_name} might not be supported on Fedora release ${::operatingsystemmajrelease}")
}
}
}
'fedora': {
if ($::operatingsystemmajrelease >= 20) {
$udev_package = 'systemd'
$udevtrigger = 'udevadm trigger'
$udevlogpriority = 'udevadm control --log-priority'
}
else {
fail("Module ${module_name} might not be supported on Fedora release ${::operatingsystemmajrelease}")
} else {
case $::operatingsystemmajrelease {
'5': {
$udev_package = 'udev'
$udevtrigger = 'udevtrigger'
$udevlogpriority = 'udevcontrol log_priority'
}
'6','7': {
$udev_package = 'udev'
$udevtrigger = 'udevadm trigger'
$udevlogpriority = 'udevadm control --log-priority'
}
default: {
fail("Module ${module_name} is not supported on RedHat release ${::operatingsystemmajrelease}")
}
}
}
}
default: {
fail("Module ${module_name} is not supported on ${::operatingsystem}")
}
Expand Down

0 comments on commit afd6ec5

Please sign in to comment.