nginx: Merge from parameterize branch
This commit is contained in:
parent
55c8b7bd5f
commit
a0c2c84e0d
1 changed files with 15 additions and 4 deletions
|
@ -1,6 +1,15 @@
|
||||||
# Install and configure nginx.
|
# Install and configure nginx.
|
||||||
#
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# $chroot:
|
||||||
|
# Use chroot on OpenBSD. Defaults to true.
|
||||||
|
#
|
||||||
|
# $workers:
|
||||||
|
# Number of worker processes. Defaults to $processorcount.
|
||||||
|
#
|
||||||
class nginx(
|
class nginx(
|
||||||
|
$chroot=true,
|
||||||
$workers=$::processorcount,
|
$workers=$::processorcount,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -9,6 +18,12 @@ class nginx(
|
||||||
$user = 'www'
|
$user = 'www'
|
||||||
$group = 'www'
|
$group = 'www'
|
||||||
$logdir = '/var/www/logs'
|
$logdir = '/var/www/logs'
|
||||||
|
|
||||||
|
if ! $chroot {
|
||||||
|
Service['nginx'] {
|
||||||
|
flags => '-u',
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
'ubuntu': {
|
'ubuntu': {
|
||||||
$user = 'www-data'
|
$user = 'www-data'
|
||||||
|
@ -59,10 +74,6 @@ class nginx(
|
||||||
service { 'nginx':
|
service { 'nginx':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
start => $::operatingsystem ? {
|
|
||||||
'openbsd' => '/usr/sbin/nginx -u',
|
|
||||||
default => undef,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue