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.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $chroot:
|
||||
# Use chroot on OpenBSD. Defaults to true.
|
||||
#
|
||||
# $workers:
|
||||
# Number of worker processes. Defaults to $processorcount.
|
||||
#
|
||||
class nginx(
|
||||
$chroot=true,
|
||||
$workers=$::processorcount,
|
||||
) {
|
||||
|
||||
|
@ -9,6 +18,12 @@ class nginx(
|
|||
$user = 'www'
|
||||
$group = 'www'
|
||||
$logdir = '/var/www/logs'
|
||||
|
||||
if ! $chroot {
|
||||
Service['nginx'] {
|
||||
flags => '-u',
|
||||
}
|
||||
}
|
||||
}
|
||||
'ubuntu': {
|
||||
$user = 'www-data'
|
||||
|
@ -59,10 +74,6 @@ class nginx(
|
|||
service { 'nginx':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
start => $::operatingsystem ? {
|
||||
'openbsd' => '/usr/sbin/nginx -u',
|
||||
default => undef,
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue