diff --git a/spec/defines/resource_stream_spec.rb b/spec/defines/resource_stream_spec.rb index a5db4692e..adcad607e 100644 --- a/spec/defines/resource_stream_spec.rb +++ b/spec/defines/resource_stream_spec.rb @@ -101,6 +101,12 @@ value: 'spdy', match: %r{\s+listen\s+\[::\]:80 spdy;} }, + { + title: 'should set resolver(s)', + attr: 'resolver', + value: ['203.0.113.1', '203.0.113.2'], + match: %r{\s+resolver\s+203.0.113.1 203.0.113.2;} + }, { title: 'should contain raw_prepend directives', attr: 'raw_prepend', diff --git a/templates/streamhost/streamhost.erb b/templates/streamhost/streamhost.erb index a8ce85bd9..75bc48ee0 100644 --- a/templates/streamhost/streamhost.erb +++ b/templates/streamhost/streamhost.erb @@ -18,6 +18,9 @@ server { listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>; <%- end -%> <%- end -%> +<%- unless @resolver.empty? -%> + resolver <% @resolver.each do |res| %> <%= res %><% end %>; +<%- end -%> <% Array(@raw_prepend).each do |line| -%> <%= line %>