From a0c2c84e0d696c194163259d58e724042520e9f9 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 18 Apr 2016 15:31:52 +0300 Subject: [PATCH] nginx: Merge from parameterize branch --- nginx/manifests/init.pp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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, - }, } }