diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index f3f41ce63..fed1912b8 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -159,7 +159,7 @@ String $server = undef, Optional[String] $www_root = undef, Optional[String] $autoindex = undef, - Optional[Array] $index_files = [ + Array $index_files = [ 'index.html', 'index.htm', 'index.php'], diff --git a/manifests/resource/server.pp b/manifests/resource/server.pp index 6e4d44d7a..e0200fa3e 100644 --- a/manifests/resource/server.pp +++ b/manifests/resource/server.pp @@ -200,7 +200,7 @@ Optional[String] $uwsgi = undef, Optional[String] $uwsgi_params = "${nginx::config::conf_dir}/uwsgi_params", Optional[String] $uwsgi_read_timeout = undef, - Optional[Array] $index_files = [ + Array $index_files = [ 'index.html', 'index.htm', 'index.php'], diff --git a/spec/defines/resource_location_spec.rb b/spec/defines/resource_location_spec.rb index ffd940112..22bab3c4b 100644 --- a/spec/defines/resource_location_spec.rb +++ b/spec/defines/resource_location_spec.rb @@ -339,6 +339,12 @@ attr: 'index_files', value: %w[name1 name2], match: ' index name1 name2;' + }, + { + title: 'should not set index_file(s)', + attr: 'index_files', + value: [], + notmatch: %r{\s+index\s+} } ].each do |param| context "when #{param[:attr]} is #{param[:value]}" do @@ -391,6 +397,12 @@ attr: 'index_files', value: %w[name1 name2], match: ' index name1 name2;' + }, + { + title: 'should not set index_file(s)', + attr: 'index_files', + value: [], + notmatch: %r{\s+index\s+} } ].each do |param| context "when #{param[:attr]} is #{param[:value]}" do diff --git a/spec/defines/resource_server_spec.rb b/spec/defines/resource_server_spec.rb index 82bbac8bc..7431ef361 100644 --- a/spec/defines/resource_server_spec.rb +++ b/spec/defines/resource_server_spec.rb @@ -329,8 +329,8 @@ { title: 'should not set index_file(s)', attr: 'index_files', - value: :undef, - match: %r{^((?!index).)*$} + value: [], + notmatch: %r{\s+index\s+} } ].each do |param| context "when #{param[:attr]} is #{param[:value]}" do @@ -757,8 +757,8 @@ { title: 'should not set index_file(s)', attr: 'index_files', - value: :undef, - match: %r{^((?!index).)*$} + value: [], + notmatch: %r{\s+index\s+} } ].each do |param| context "when #{param[:attr]} is #{param[:value]}" do