config: refined worker_processes validation

Closes #540
This commit is contained in:
Matthew Haughton 2015-04-01 23:34:31 -04:00
parent e6d1695f82
commit 810d36d3a8
2 changed files with 7 additions and 1 deletions

View file

@ -94,7 +94,7 @@ class nginx::config(
) inherits ::nginx::params {
### Validations ###
if (!is_string($worker_processes)) and (!is_integer($worker_processes)) {
if ($worker_processes != 'auto') and (!is_integer($worker_processes)) {
fail('$worker_processes must be an integer or have value "auto".')
}
if (!is_integer($worker_connections)) {

View file

@ -76,6 +76,12 @@ describe 'nginx::config' do
:value => '4',
:match => 'worker_processes 4;',
},
{
:title => 'should set worker_processes',
:attr => 'worker_processes',
:value => 'auto',
:match => 'worker_processes auto;',
},
{
:title => 'should set worker_rlimit_nofile',
:attr => 'worker_rlimit_nofile',