diff --git a/manifests/package.pp b/manifests/package.pp index ac062697f..b39021d6e 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -24,7 +24,7 @@ assert_private() - case $::osfamily { + case $facts['os']['family'] { 'redhat': { contain ::nginx::package::redhat } diff --git a/manifests/package/debian.pp b/manifests/package/debian.pp index 43c215a26..f212b1844 100644 --- a/manifests/package/debian.pp +++ b/manifests/package/debian.pp @@ -22,7 +22,7 @@ $passenger_package_ensure = $::nginx::passenger_package_ensure $manage_repo = $::nginx::manage_repo - $distro = downcase($::operatingsystem) + $distro = downcase($facts['os']['name']) package { 'nginx': ensure => $package_ensure, diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index 5b33a1d34..66c38ca74 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -25,7 +25,7 @@ #Install the CentOS-specific packages on that OS, otherwise assume it's a RHEL #clone and provide the Red Hat-specific package. This comes into play when not #on RHEL or CentOS and $manage_repo is set manually to 'true'. - $_os = $::operatingsystem? { + $_os = $facts['os']['name'] ? { 'centos' => 'centos', default => 'rhel' } @@ -34,7 +34,7 @@ case $package_source { 'nginx', 'nginx-stable': { yumrepo { 'nginx-release': - baseurl => "http://nginx.org/packages/${_os}/${::operatingsystemmajrelease}/\$basearch/", + baseurl => "http://nginx.org/packages/${_os}/${facts['os']['release']['major']}/\$basearch/", descr => 'nginx repo', enabled => '1', gpgcheck => '1', @@ -51,7 +51,7 @@ } 'nginx-mainline': { yumrepo { 'nginx-release': - baseurl => "http://nginx.org/packages/mainline/${_os}/${::operatingsystemmajrelease}/\$basearch/", + baseurl => "http://nginx.org/packages/mainline/${_os}/${facts['os']['release']['major']}/\$basearch/", descr => 'nginx repo', enabled => '1', gpgcheck => '1', @@ -67,9 +67,9 @@ } 'passenger': { - if ($::operatingsystem in ['RedHat', 'CentOS']) and ($::operatingsystemmajrelease in ['6', '7']) { + if ($facts['os']['name'] in ['RedHat', 'CentOS']) and ($facts['os']['release']['major'] in ['6', '7']) { yumrepo { 'passenger': - baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${::operatingsystemmajrelease}/\$basearch", + baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${facts['os']['release']['major']}/\$basearch", descr => 'passenger repo', enabled => '1', gpgcheck => '0', @@ -90,7 +90,7 @@ } } else { - fail("${::operatingsystem} version ${::operatingsystemmajrelease} is unsupported with \$package_source 'passenger'") + fail("${facts['os']['name']} version ${facts['os']['release']['major']} is unsupported with \$package_source 'passenger'") } } default: { diff --git a/manifests/params.pp b/manifests/params.pp index df2bcd89d..a4d58ec4f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -17,7 +17,7 @@ 'package_name' => 'nginx', 'manage_repo' => false, } - case $::osfamily { + case $facts['os']['family'] { 'ArchLinux': { $_module_os_overrides = { 'pid' => false, @@ -27,8 +27,8 @@ } } 'Debian': { - if ($::operatingsystem == 'ubuntu' and $::lsbdistcodename in ['lucid', 'precise', 'trusty', 'xenial']) - or ($::operatingsystem == 'debian' and $::operatingsystemmajrelease in ['6', '7', '8']) { + if ($facts['os']['name'] == 'ubuntu' and $facts['lsbdistcodename'] in ['lucid', 'precise', 'trusty', 'xenial']) + or ($facts['os']['name'] == 'debian' and $facts['os']['release']['major'] in ['6', '7', '8']) { $_module_os_overrides = { 'manage_repo' => true, 'daemon_user' => 'www-data', @@ -55,7 +55,7 @@ } } 'RedHat': { - if ($::operatingsystem in ['RedHat', 'CentOS', 'Oracle'] and $::operatingsystemmajrelease in ['6', '7']) { + if ($facts['os']['name'] in ['RedHat', 'CentOS', 'Oracle'] and $facts['os']['release']['major'] in ['6', '7']) { $_module_os_overrides = { 'manage_repo' => true, 'log_group' => 'nginx', @@ -83,7 +83,7 @@ } default: { ## For cases not covered in $::osfamily - case $::operatingsystem { + case $facts['os']['name'] { 'SmartOS': { $_module_os_overrides = { 'conf_dir' => '/usr/local/etc/nginx', diff --git a/manifests/resource/streamhost.pp b/manifests/resource/streamhost.pp index 23e9292d0..01cdd298e 100644 --- a/manifests/resource/streamhost.pp +++ b/manifests/resource/streamhost.pp @@ -98,7 +98,7 @@ # Add IPv6 Logic Check - Nginx service will not start if ipv6 is enabled # and support does not exist for it in the kernel. - if ($ipv6_enable == true) and (!$::ipaddress6) { + if ($ipv6_enable == true) and (!$facts['ipaddress6']) { warning('nginx: IPv6 support is not enabled or configured properly') } diff --git a/manifests/resource/upstream/member.pp b/manifests/resource/upstream/member.pp index 2af034c8f..de597db36 100644 --- a/manifests/resource/upstream/member.pp +++ b/manifests/resource/upstream/member.pp @@ -20,10 +20,10 @@ # # Exporting the resource on a upstream member server: # -# @@nginx::resource::upstream::member { $::fqdn: +# @@nginx::resource::upstream::member { $trusted['certname']: # ensure => present, # upstream => 'proxypass', -# server => $::ipaddress, +# server => $facts['networking']['ip'], # port => 3000, # } # diff --git a/manifests/service.pp b/manifests/service.pp index a797f57ef..d0ec3f36d 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -38,7 +38,7 @@ } if $service_manage { - case $::osfamily { + case $facts['os']['name'] { 'OpenBSD': { service { $service_name: ensure => $service_ensure_real,