Merge pull request #290 from pderaaij/master

Add configuring multiple resolvers via an array instead of a string
This commit is contained in:
James Fryman 2014-04-06 09:14:21 -05:00
commit b0efd27ae0
2 changed files with 5 additions and 7 deletions

View file

@ -34,7 +34,7 @@
# nginx::resource::upstream # nginx::resource::upstream
# [*proxy_read_timeout*] - Override the default the proxy read timeout value # [*proxy_read_timeout*] - Override the default the proxy read timeout value
# of 90 seconds # of 90 seconds
# [*resolver*] - String: Configures name servers used to resolve # [*resolver*] - Array: Configures name servers used to resolve
# names of upstream servers into addresses. # names of upstream servers into addresses.
# [*fastcgi*] - location of fastcgi (host:port) # [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_params*] - optional alternative fastcgi_params file to use # [*fastcgi_params*] - optional alternative fastcgi_params file to use
@ -151,7 +151,7 @@ define nginx::resource::vhost (
$proxy_cache_valid = false, $proxy_cache_valid = false,
$proxy_method = undef, $proxy_method = undef,
$proxy_set_body = undef, $proxy_set_body = undef,
$resolver = undef, $resolver = [],
$fastcgi = undef, $fastcgi = undef,
$fastcgi_params = '/etc/nginx/fastcgi_params', $fastcgi_params = '/etc/nginx/fastcgi_params',
$fastcgi_script = undef, $fastcgi_script = undef,
@ -248,9 +248,7 @@ define nginx::resource::vhost (
if ($proxy_set_body != undef) { if ($proxy_set_body != undef) {
validate_string($proxy_set_body) validate_string($proxy_set_body)
} }
if ($resolver != undef) { validate_array($resolver)
validate_string($resolver)
}
if ($fastcgi != undef) { if ($fastcgi != undef) {
validate_string($fastcgi) validate_string($fastcgi)
} }

View file

@ -32,8 +32,8 @@ server {
<% if defined? @ssl_trusted_cert -%> <% if defined? @ssl_trusted_cert -%>
ssl_trusted_certificate <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/<%= @name.gsub(' ', '_') %>.trusted.crt; ssl_trusted_certificate <%= scope.lookupvar('nginx::params::nx_conf_dir') %>/<%= @name.gsub(' ', '_') %>.trusted.crt;
<% end -%> <% end -%>
<% if defined? @resolver -%> <% if @resolver.count > 0 -%>
resolver <%= @resolver %>; resolver <% Array(@resolver).each do |r| %> <%= r %><% end %>;
<% end -%> <% end -%>
<% if defined? @auth_basic -%> <% if defined? @auth_basic -%>
auth_basic "<%= @auth_basic %>"; auth_basic "<%= @auth_basic %>";