From 6cab5a5d782d939a2b272fe15694a0c9e9201913 Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Thu, 31 Jul 2014 16:40:17 +0100 Subject: [PATCH 1/2] Allow usage on more recent Fedora systems. --- manifests/params.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index fea23bd..9916dda 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,21 +3,23 @@ # This class should be considered private. # class udev::params { - $udev_package = 'udev' $udevadm_path = '/sbin' - case $::osfamily { + case $::operatingsystem { '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' $udevtrigger = 'udevadm trigger' $udevlogpriority = 'udevadm control --log-priority' } @@ -26,6 +28,16 @@ } } } + '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}") + } + } default: { fail("Module ${module_name} is not supported on ${::operatingsystem}") } From afd6ec5e1b221f49c7382aac836541109e71ba3c Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Thu, 31 Jul 2014 18:51:42 +0100 Subject: [PATCH 2/2] Reinstate the operatingsystem check. --- manifests/params.pp | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 9916dda..5786c61 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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}") }