From bbf820c09e84030aba1663371c74114482ad149b Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Thu, 20 Mar 2014 11:40:40 -0400 Subject: [PATCH 1/6] Replaced hardcoded values with scopelookup --- templates/conf.d/nginx.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index 122441622..dac0455b1 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -12,7 +12,7 @@ events { } http { - include /etc/nginx/mime.types; + include <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/mime.types; default_type application/octet-stream; access_log <%= @http_access_log %>; @@ -44,7 +44,7 @@ http { <% end -%> <% end -%> - include /etc/nginx/conf.d/*.conf; + include <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/conf.d/*.conf; include <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/sites-enabled/*; } From c23e0ce7af883e273ce8f3b5469451b2995bef91 Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Thu, 20 Mar 2014 11:42:18 -0400 Subject: [PATCH 2/6] conditionals for nx_conf_dir and SmartOS nx_daemon_user --- manifests/params.pp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 0a5ab8596..17fd26d81 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,7 +22,6 @@ $nx_temp_dir = '/tmp' $nx_run_dir = '/var/nginx' - $nx_conf_dir = '/etc/nginx' $nx_conf_template = 'nginx/conf.d/nginx.conf.erb' $nx_proxy_conf_template = 'nginx/conf.d/proxy.conf.erb' $nx_confd_purge = false @@ -81,10 +80,26 @@ } if $::osfamily { + $nx_conf_dir = $::osfamily ? { + /(?i-mx:solaris)/ => '/opt/local/etc/nginx', + default => '/etc/nginx/', + } + } else { + $nx_conf_dir = $::operatingsystem ? { + /(?i-mx:solaris|smartos)/ => '/opt/local/etc/nginx', + default => '/etc/nginx', + } + } + + if $::osfamily { + $solaris_nx_daemon_user = $::operatingsystem ? { + /(?i-mx:smartos)/ => 'www', + default => 'webservd', + } $nx_daemon_user = $::osfamily ? { /(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx', /(?i-mx:debian)/ => 'www-data', - /(?i-mx:solaris)/ => 'webservd', + /(?i-mx:solaris)/ => $solaris_nx_daemon_user, } } else { warning('$::osfamily not defined. Support for $::operatingsystem is deprecated') From 8ee7964d2b4353d7d818000e91f05a35128465d4 Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Thu, 20 Mar 2014 18:00:56 -0400 Subject: [PATCH 3/6] Replaced ::operatingsystem with ::kernelversion --- manifests/params.pp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 17fd26d81..07e506ca8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -79,23 +79,16 @@ /(?i-mx:sunos)/ => '/var/run/nginx.pid', } - if $::osfamily { - $nx_conf_dir = $::osfamily ? { - /(?i-mx:solaris)/ => '/opt/local/etc/nginx', - default => '/etc/nginx/', - } - } else { - $nx_conf_dir = $::operatingsystem ? { - /(?i-mx:solaris|smartos)/ => '/opt/local/etc/nginx', - default => '/etc/nginx', - } + $nx_conf_dir = $::kernelversion ? { + /(?i-mx:joyent)/ => '/opt/local/etc/nginx', + default => '/etc/nginx/', } if $::osfamily { - $solaris_nx_daemon_user = $::operatingsystem ? { - /(?i-mx:smartos)/ => 'www', + $solaris_nx_daemon_user = $::kernelversion ? { + /(?i-mx:joyent)/ => 'www', default => 'webservd', - } + } $nx_daemon_user = $::osfamily ? { /(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx', /(?i-mx:debian)/ => 'www-data', From 6fe431f698a4831952b20101c271dd9868604372 Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Mon, 24 Mar 2014 17:07:38 -0400 Subject: [PATCH 4/6] SmartOS support --- manifests/params.pp | 2 +- templates/conf.d/nginx.conf.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 07e506ca8..7b9d1cf66 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -81,7 +81,7 @@ $nx_conf_dir = $::kernelversion ? { /(?i-mx:joyent)/ => '/opt/local/etc/nginx', - default => '/etc/nginx/', + default => '/etc/nginx', } if $::osfamily { diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index dac0455b1..62e49e2a3 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -50,6 +50,6 @@ http { } <% if scope.lookupvar('nginx::mail') %> mail { - include /etc/nginx/conf.mail.d/*.conf; + include <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/conf.mail.d/*.conf; } <% end -%> From 64047f42fbf0dd62d144afffbf80b1a516f1bde5 Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Mon, 24 Mar 2014 17:14:32 -0400 Subject: [PATCH 5/6] SmartOS support --- manifests/params.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 7b9d1cf66..36eb06b23 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -45,7 +45,6 @@ $nx_spdy = off $nx_ssl_stapling = off - $nx_proxy_redirect = off $nx_proxy_set_header = [ 'Host $host', @@ -81,13 +80,13 @@ $nx_conf_dir = $::kernelversion ? { /(?i-mx:joyent)/ => '/opt/local/etc/nginx', - default => '/etc/nginx', + default => '/etc/nginx', } if $::osfamily { $solaris_nx_daemon_user = $::kernelversion ? { /(?i-mx:joyent)/ => 'www', - default => 'webservd', + default => 'webservd', } $nx_daemon_user = $::osfamily ? { /(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx', From 61dd9cd686cc2bde85e855a3c7fe242159b17ea5 Mon Sep 17 00:00:00 2001 From: Joshua Moore Date: Mon, 24 Mar 2014 17:21:33 -0400 Subject: [PATCH 6/6] Deleted ruby 1.8.7 tests support --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a7c15d835..61c92863a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,4 @@ matrix: env: PUPPET_GEM_VERSION="~> 2.7.0" gemfile: .travis/Gemfile notifications: - email: false + email: false