commit
e79e91d945
8 changed files with 63 additions and 17 deletions
|
@ -65,6 +65,14 @@ class nginx::package(
|
|||
before => Anchor['nginx::package::end'],
|
||||
}
|
||||
}
|
||||
'FreeBSD': {
|
||||
class { 'nginx::package::freebsd':
|
||||
package_name => $package_name,
|
||||
package_ensure => $package_ensure,
|
||||
require => Anchor['nginx::package::begin'],
|
||||
before => Anchor['nginx::package::end'],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
case $::operatingsystem {
|
||||
'amazon': {
|
||||
|
|
12
manifests/package/freebsd.pp
Normal file
12
manifests/package/freebsd.pp
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Class: nginx::package::freebsd
|
||||
#
|
||||
# Manage the nginx package on FreeBSD
|
||||
class nginx::package::freebsd (
|
||||
$package_name = 'nginx',
|
||||
$package_ensure = 'present'
|
||||
) {
|
||||
|
||||
package { $package_name:
|
||||
ensure => $package_ensure,
|
||||
}
|
||||
}
|
|
@ -74,24 +74,25 @@ class nginx::params {
|
|||
$nx_proxy_buffer_size = '8k'
|
||||
$nx_proxy_headers_hash_bucket_size = '64'
|
||||
|
||||
$nx_logdir = $::kernel ? {
|
||||
/(?i-mx:linux)/ => '/var/log/nginx',
|
||||
/(?i-mx:sunos)/ => '/var/log/nginx',
|
||||
}
|
||||
$nx_logdir = '/var/log/nginx'
|
||||
|
||||
$nx_pid = $::kernel ? {
|
||||
/(?i-mx:linux)/ => $::osfamily ? {
|
||||
/(?i-mx:linux)/ => $::osfamily ? {
|
||||
# archlinux has hardcoded pid in service file to /run/nginx.pid, setting
|
||||
# it will prevent nginx from starting
|
||||
/(?i-mx:archlinux)/ => false,
|
||||
default => '/var/run/nginx.pid',
|
||||
},
|
||||
/(?i-mx:sunos)/ => '/var/run/nginx.pid',
|
||||
/(?i-mx:sunos)/ => '/var/run/nginx.pid',
|
||||
/(?i-mx:freebsd)/ => '/var/run/nginx.pid',
|
||||
}
|
||||
|
||||
$nx_conf_dir = $::kernelversion ? {
|
||||
/(?i-mx:joyent)/ => '/opt/local/etc/nginx',
|
||||
default => '/etc/nginx',
|
||||
/(?i-mx:joyent)/ => '/opt/local/etc/nginx',
|
||||
default => $::kernel ? {
|
||||
/(?i-mx:freebsd)/ => '/usr/local/etc/nginx',
|
||||
default => '/etc/nginx',
|
||||
}
|
||||
}
|
||||
|
||||
if $::osfamily {
|
||||
|
@ -104,6 +105,7 @@ class nginx::params {
|
|||
/(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx',
|
||||
/(?i-mx:debian)/ => 'www-data',
|
||||
/(?i-mx:solaris)/ => $solaris_nx_daemon_user,
|
||||
/(?i-mx:freebsd)/ => 'www',
|
||||
}
|
||||
} else {
|
||||
warning('$::osfamily not defined. Support for $::operatingsystem is deprecated')
|
||||
|
@ -113,9 +115,15 @@ class nginx::params {
|
|||
/(?i-mx:debian|ubuntu)/ => 'www-data',
|
||||
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo|oraclelinux)/ => 'nginx',
|
||||
/(?i-mx:solaris)/ => 'webservd',
|
||||
/(?i-mx:freebsd)/ => 'www',
|
||||
}
|
||||
}
|
||||
|
||||
$root_group = $::operatingsystem ? {
|
||||
'FreeBSD' => 'wheel',
|
||||
default => 'root',
|
||||
}
|
||||
|
||||
# Nginx is default launched as root if not change this parameter
|
||||
$nx_super_user = true
|
||||
|
||||
|
@ -143,11 +151,11 @@ class nginx::params {
|
|||
|
||||
# Specific owner for sites-available directory
|
||||
$sites_available_owner = 'root'
|
||||
$sites_available_group = 'root'
|
||||
$sites_available_group = $root_group
|
||||
$sites_available_mode = '0644'
|
||||
|
||||
# Owner for all other files
|
||||
$global_owner = 'root'
|
||||
$global_group = 'root'
|
||||
$global_group = $root_group
|
||||
$global_mode = '0644'
|
||||
}
|
||||
|
|
|
@ -73,9 +73,12 @@ define nginx::resource::geo (
|
|||
if ($proxies != undef) { validate_array($proxies) }
|
||||
if ($proxy_recursive != undef) { validate_bool($proxy_recursive) }
|
||||
|
||||
include nginx::params
|
||||
$root_group = $nginx::params::root_group
|
||||
|
||||
File {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
|
|
|
@ -152,9 +152,13 @@ define nginx::resource::location (
|
|||
$rewrite_rules = [],
|
||||
$priority = 500
|
||||
) {
|
||||
|
||||
include nginx::params
|
||||
$root_group = $nginx::params::root_group
|
||||
|
||||
File {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
|
|
|
@ -58,10 +58,15 @@ define nginx::resource::mailhost (
|
|||
$protocol = undef,
|
||||
$auth_http = undef,
|
||||
$xclient = 'on',
|
||||
$server_name = [$name]) {
|
||||
$server_name = [$name]
|
||||
) {
|
||||
|
||||
include nginx::params
|
||||
$root_group = $nginx::params::root_group
|
||||
|
||||
File {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
|
@ -118,7 +123,7 @@ define nginx::resource::mailhost (
|
|||
|
||||
concat { $config_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
|
|
|
@ -57,9 +57,12 @@ define nginx::resource::map (
|
|||
"Invalid ensure value '${ensure}'. Expected 'present' or 'absent'")
|
||||
if ($default != undef) { validate_string($default) }
|
||||
|
||||
include nginx::params
|
||||
$root_group = $nginx::params::root_group
|
||||
|
||||
File {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
|
|
|
@ -54,9 +54,12 @@ define nginx::resource::upstream (
|
|||
validate_hash($upstream_cfg_prepend)
|
||||
}
|
||||
|
||||
include nginx::params
|
||||
$root_group = $nginx::params::root_group
|
||||
|
||||
Concat {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
group => $root_group,
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue