Skip to content

Commit

Permalink
Merge pull request #280 from ok-devalias/master
Browse files Browse the repository at this point in the history
SmartOS support
  • Loading branch information
James Fryman committed Mar 24, 2014
2 parents 53e9fe5 + 61dd9cd commit ac0f4ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ matrix:
env: PUPPET_GEM_VERSION="~> 2.7.0"
gemfile: .travis/Gemfile
notifications:
email: false
email: false
13 changes: 10 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,7 +45,6 @@
$nx_spdy = off
$nx_ssl_stapling = off


$nx_proxy_redirect = off
$nx_proxy_set_header = [
'Host $host',
Expand Down Expand Up @@ -80,11 +78,20 @@
/(?i-mx:sunos)/ => '/var/run/nginx.pid',
}

$nx_conf_dir = $::kernelversion ? {
/(?i-mx:joyent)/ => '/opt/local/etc/nginx',
default => '/etc/nginx',
}

if $::osfamily {
$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',
/(?i-mx:solaris)/ => 'webservd',
/(?i-mx:solaris)/ => $solaris_nx_daemon_user,
}
} else {
warning('$::osfamily not defined. Support for $::operatingsystem is deprecated')
Expand Down
6 changes: 3 additions & 3 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>;
Expand Down Expand Up @@ -44,12 +44,12 @@ 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/*;

}
<% 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 -%>

0 comments on commit ac0f4ca

Please sign in to comment.