Skip to content

Commit 751a315

Browse files
committed
drop support for versions < 1.15.0
1 parent 7f3a8ae commit 751a315

File tree

8 files changed

+8
-63
lines changed

8 files changed

+8
-63
lines changed

REFERENCE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ Data type: `String[1]`
277277
The version of nginx installed (or being installed).
278278
Unfortunately, different versions of nginx may need configuring
279279
differently. The default is derived from the version of nginx
280-
already installed. If the fact is unavailable, it defaults to '1.6.0'.
280+
already installed. If the fact is unavailable, it defaults to '1.15.0'.
281281
You may need to set this manually to get a working and idempotent
282282
configuration.
283283

284-
Default value: `pick(fact('nginx_version'), '1.6.0')`
284+
Default value: `pick(fact('nginx_version'), '1.15.0')`
285285

286286
##### <a name="-nginx--debug_connections"></a>`debug_connections`
287287

@@ -3080,7 +3080,7 @@ Create a new mapping entry for NGINX
30803080
nginx::resource::map { 'backend_pool':
30813081
ensure => present,
30823082
hostnames => true,
3083-
default => 'ny-pool-1,
3083+
default => 'ny-pool-1',
30843084
string => '$http_host',
30853085
mappings => {
30863086
'*.nyc.example.com' => 'ny-pool-1',

manifests/init.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# The version of nginx installed (or being installed).
2121
# Unfortunately, different versions of nginx may need configuring
2222
# differently. The default is derived from the version of nginx
23-
# already installed. If the fact is unavailable, it defaults to '1.6.0'.
23+
# already installed. If the fact is unavailable, it defaults to '1.15.0'.
2424
# You may need to set this manually to get a working and idempotent
2525
# configuration.
2626
#
@@ -240,7 +240,7 @@
240240
Hash $nginx_upstreams = {},
241241
Nginx::UpstreamDefaults $nginx_upstreams_defaults = {},
242242
Boolean $purge_passenger_repo = true,
243-
String[1] $nginx_version = pick(fact('nginx_version'), '1.6.0'),
243+
String[1] $nginx_version = pick(fact('nginx_version'), '1.15.0'),
244244

245245
### END Hiera Lookups ###
246246
) inherits nginx::params {

spec/acceptance/nginx_mail_spec.rb

-40
Original file line numberDiff line numberDiff line change
@@ -79,45 +79,5 @@ class { 'nginx':
7979
describe port(465) do
8080
it { is_expected.to be_listening }
8181
end
82-
83-
context 'when configured for nginx 1.14' do
84-
it 'runs successfully' do
85-
pp = "
86-
if fact('os.family') == 'RedHat' {
87-
package { 'nginx-mod-mail':
88-
ensure => installed,
89-
}
90-
}
91-
92-
class { 'nginx':
93-
mail => true,
94-
nginx_version => '1.14.0',
95-
dynamic_modules => fact('os.family') ? {
96-
'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'],
97-
default => [],
98-
}
99-
}
100-
nginx::resource::mailhost { 'domain1.example':
101-
ensure => present,
102-
auth_http => 'localhost/cgi-bin/auth',
103-
protocol => 'smtp',
104-
listen_port => 587,
105-
ssl => true,
106-
ssl_port => 465,
107-
ssl_cert => '/etc/pki/tls/certs/blah.cert',
108-
ssl_key => '/etc/pki/tls/private/blah.key',
109-
xclient => 'off',
110-
}
111-
"
112-
113-
apply_manifest(pp, catch_failures: true)
114-
end
115-
116-
describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
117-
it 'does\'t contain `ssl` on `listen` line' do
118-
is_expected.to contain 'listen *:465;'
119-
end
120-
end
121-
end
12282
end
12383
end

spec/defines/resource_mailhost_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
title: 'should set the IPv4 listen port',
5555
attr: 'listen_port',
5656
value: 45,
57-
match: ' listen *:45;'
57+
match: ' listen *:45 ssl;'
5858
},
5959
{
6060
title: 'should set the IPv4 listen options',
@@ -548,7 +548,7 @@
548548
title: 'should set the IPv4 SSL listen port',
549549
attr: 'ssl_port',
550550
value: 45,
551-
match: ' listen *:45;'
551+
match: ' listen *:45 ssl;'
552552
},
553553
{
554554
title: 'should enable IPv6',

spec/defines/resource_server_spec.rb

-6
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,6 @@
675675
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ ssl on;}) }
676676
end
677677

678-
context 'with fact nginx_version=1.14.1' do
679-
let(:facts) { facts.merge(nginx_version: '1.14.1') }
680-
681-
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ ssl on;}) }
682-
end
683-
684678
context 'with fact nginx_version=1.15.1' do
685679
let(:facts) { facts.merge(nginx_version: '1.15.1') }
686680

templates/mailhost/mailhost.epp

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ server {
2323
<%- } -%>
2424
<%= $mailhost_common -%>
2525

26-
<%- if versioncmp($nginx_version, '1.15.0') < 0 { -%>
27-
ssl off;
28-
<% } %>
2926
starttls <%= $starttls %>;
3027

3128
<% if $starttls != 'off' { %>

templates/mailhost/mailhost_ssl.epp

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
server {
1515
<%= $mailhost_prepend -%>
1616
<%- $listen_ip.each |$ip| { -%>
17-
listen <%= $ip %>:<%= $ssl_port %><% if versioncmp($nginx_version, '1.15.0') >= 0 { %> ssl<% } %>;
17+
listen <%= $ip %>:<%= $ssl_port %> ssl;
1818
<%- } -%>
1919
<%- $ipv6_listen_ip.each |$ipv6| { -%>
2020
listen [<%= $ipv6 %>]:<%= $ssl_port %> <% if $ipv6_listen_options { %><%= $ipv6_listen_options %><% } %>;
2121
<%- } -%>
2222
<%= $mailhost_common -%>
2323

24-
<%- if versioncmp($nginx_version, '1.15.0') < 0 { -%>
25-
ssl on;
26-
<% } %>
2724
starttls off;
2825

2926
<%= $mailhost_ssl_settings -%>

templates/server/server_ssl_settings.erb

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.15.0']) < 0 -%>
2-
ssl on;
3-
<% end -%>
41
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) >= 0 && @http2 -%>
52
http2 <%= @http2 %>;
63
<% end -%>

0 commit comments

Comments
 (0)