diff --git a/nginx/manifests/init.pp b/nginx/manifests/init.pp index c85fcc0..3829279 100644 --- a/nginx/manifests/init.pp +++ b/nginx/manifests/init.pp @@ -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, - }, } }