From 8da21ee07833fc956f3dd3749ad0576c1068ce0a Mon Sep 17 00:00:00 2001 From: drfeelngood Date: Mon, 18 Nov 2013 10:29:44 -0600 Subject: [PATCH] Updated params to account for oracle linux. We should analyze the $::osfamily fact to define $nx_daemon_user. Support for $::operatingsystem remains but is greeted with a deprecation warning that suggests upgrading to factor >= 1.7.2. Corrected spec failures in redhat.pp when evaluating an undef $::lsbmajdistrelease. Now the variable must be defined before comparison. --- manifests/package/redhat.pp | 2 +- manifests/params.pp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index ad4dcb37f..4161e3f1c 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -26,7 +26,7 @@ # fedora 19 has 1.4.x packages are in # fedora 18 users will need to supply their own nginx 1.4 rpms and/or repo - if $::lsbmajdistrelease < 19 { + if $::lsbmajdistrelease and $::lsbmajdistrelease < 19 { notice("${::operatingsystem} ${::lsbmajdistrelease} does not supply nginx >= 1.4 packages") } } diff --git a/manifests/params.pp b/manifests/params.pp index 47bdba7c3..2356f32d5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -68,9 +68,18 @@ /(?i-mx:linux)/ => '/var/run/nginx.pid', } - $nx_daemon_user = $::operatingsystem ? { - /(?i-mx:debian|ubuntu)/ => 'www-data', - /(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo)/ => 'nginx', + if $::osfamily { + $nx_daemon_user = $::osfamily ? { + /(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx', + /(?i-mx:debian)/ => 'www-data', + } + } else { + warning('$::osfamily not defined. Support for $::operatingsystem is deprecated') + warning("Please upgrade from factor ${::facterversion} to >= 1.7.2") + $nx_daemon_user = $::operatingsystem ? { + /(?i-mx:debian|ubuntu)/ => 'www-data', + /(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo|oraclelinux)/ => 'nginx', + } } # Service restart after Nginx 0.7.53 could also be just