Merge pull request #249 from fadenb/bug/duplicate_listen_option_ipv6only

Bugfix for duplicate listen option caused by hardcoded `ipv6only=on` in template
This commit is contained in:
James Fryman 2014-02-04 06:20:57 -08:00
commit de428893f2
8 changed files with 12 additions and 12 deletions

View file

@ -49,7 +49,7 @@ define nginx::resource::mailhost (
$ipv6_enable = false,
$ipv6_listen_ip = '::',
$ipv6_listen_port = '80',
$ipv6_listen_options = 'default',
$ipv6_listen_options = 'default ipv6only=on',
$ssl = false,
$ssl_cert = undef,
$ssl_key = undef,
@ -64,7 +64,7 @@ define nginx::resource::mailhost (
group => 'root',
mode => '0644',
}
if !is_integer($listen_port) {
fail('$listen_port must be an integer.')
}

View file

@ -45,7 +45,7 @@
# for SSL Support. This is not generated by this module.
# [*ssl_dhparam*] - This directive specifies a file containing
# Diffie-Hellman key agreement protocol cryptographic parameters, in PEM
# format, utilized for exchanging session keys between server and client.
# format, utilized for exchanging session keys between server and client.
# [*ssl_key*] - Pre-generated SSL Key file to reference for SSL
# Support. This is not generated by this module.
# [*ssl_port*] - Default IP Port for NGINX to listen with this SSL
@ -124,7 +124,7 @@ define nginx::resource::vhost (
$ipv6_enable = false,
$ipv6_listen_ip = '::',
$ipv6_listen_port = '80',
$ipv6_listen_options = 'default',
$ipv6_listen_options = 'default ipv6only=on',
$add_header = undef,
$ssl = false,
$ssl_cert = undef,

View file

@ -85,7 +85,7 @@ describe 'nginx::resource::mailhost' do
:title => 'should set the IPv6 listen options',
:attr => 'ipv6_listen_options',
:value => 'spdy',
:match => ' listen [::]:80 spdy ipv6only=on;',
:match => ' listen [::]:80 spdy;',
},
{
:title => 'should set servername(s)',
@ -241,7 +241,7 @@ describe 'nginx::resource::mailhost' do
:title => 'should set the IPv6 listen options',
:attr => 'ipv6_listen_options',
:value => 'spdy',
:match => ' listen [::]:80 spdy ipv6only=on;',
:match => ' listen [::]:80 spdy;',
},
{
:title => 'should set servername(s)',

View file

@ -95,7 +95,7 @@ describe 'nginx::resource::vhost' do
:title => 'should set the IPv6 listen options',
:attr => 'ipv6_listen_options',
:value => 'spdy',
:match => ' listen [::]:80 spdy ipv6only=on;',
:match => ' listen [::]:80 spdy;',
},
{
:title => 'should set servername(s)',
@ -321,7 +321,7 @@ describe 'nginx::resource::vhost' do
:title => 'should set the IPv6 listen options',
:attr => 'ipv6_listen_options',
:value => 'spdy default',
:match => ' listen [::]:443 ssl spdy default ipv6only=on;',
:match => ' listen [::]:443 ssl spdy default;',
},
{
:title => 'should set servername(s)',

View file

@ -3,7 +3,7 @@ server {
listen <%= @listen_ip %>:<%= @listen_port %><% if @listen_options %> <%= @listen_options %><% end %>;
<% # check to see if ipv6 support exists in the kernel before applying %>
<% if @ipv6_enable && (defined? @ipaddress6) %>
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %> ipv6only=on;
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %>;
<% end %>
server_name <%= @server_name.join(" ") %>;
protocol <%= @protocol %>;

View file

@ -3,7 +3,7 @@ server {
listen <%= @ssl_port %>;
<% # check to see if ipv6 support exists in the kernel before applying %>
<% if @ipv6_enable && (defined? @ipaddress6) %>
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %> ipv6only=on;
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
<% end %>
server_name <%= @server_name.join(" ") %>;
protocol <%= @protocol %>;

View file

@ -2,7 +2,7 @@ server {
listen <%= @listen_ip %>:<%= @listen_port %><% if @listen_options %> <%= @listen_options %><% end %>;
<% # check to see if ipv6 support exists in the kernel before applying %>
<% if @ipv6_enable && (defined? @ipaddress6) %>
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %> ipv6only=on;
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
<% end %>
server_name <%= @rewrite_www_to_non_www ? @name.gsub(/^www\./, '') : @server_name.join(" ") %>;
<% if defined? @auth_basic -%>

View file

@ -1,7 +1,7 @@
server {
listen <%= @listen_ip %>:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @listen_options %> <%= @listen_options %><% end %>;
<% if @ipv6_enable && (defined? @ipaddress6) %>
listen [<%= @ipv6_listen_ip %>]:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %> ipv6only=on;
listen [<%= @ipv6_listen_ip %>]:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %>;
<% end %>
server_name <%= @rewrite_www_to_non_www ? @name.gsub(/^www\./, '') : @server_name.join(" ") %>;