diff --git a/manifests/config.pp b/manifests/config.pp index 6036f4ddc..f84fd2210 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -50,6 +50,7 @@ $client_body_buffer_size = '128k', $client_max_body_size = '10m', $client_body_timeout = '60', + $daemon = undef, $send_timeout = '60', $lingering_timeout = '5', $events_use = false, @@ -277,6 +278,10 @@ owner => $daemon_user, } + if ($daemon) { + validate_re($daemon, '^(on|off)$') + } + file {$proxy_temp_path: ensure => directory, owner => $daemon_user, diff --git a/manifests/init.pp b/manifests/init.pp index af2d63940..9d7c6966f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -31,6 +31,7 @@ $client_body_temp_path = undef, $client_max_body_size = undef, $events_use = undef, + $daemon = undef, $fastcgi_cache_inactive = undef, $fastcgi_cache_key = undef, $fastcgi_cache_keys_zone = undef, @@ -304,6 +305,7 @@ sites_available_owner => $sites_available_owner, sites_available_group => $sites_available_group, sites_available_mode => $sites_available_mode, + daemon => $daemon, } } diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index a9af8a969..54f80e127 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -107,6 +107,24 @@ value: 'test-user', match: 'user test-user;' }, + { + title: 'should not set daemon', + attr: 'daemon', + value: :undef, + notmatch: %r{^\s*daemon\s+} + }, + { + title: 'should set daemon on', + attr: 'daemon', + value: 'on', + match: %r{^daemon\s+on;$} + }, + { + title: 'should set daemon off', + attr: 'daemon', + value: 'off', + match: %r{^daemon\s+off;$} + }, { title: 'should set worker_processes', attr: 'worker_processes', diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index f6dcc606c..328733a71 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -1,4 +1,7 @@ # MANAGED BY PUPPET +<% if @daemon -%> +daemon <%= @daemon %>; +<% end -%> <% if @super_user -%> user <%= @daemon_user %>; <% end -%>