Skip to content

Commit

Permalink
drop support for versions < 1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeier committed May 26, 2024
1 parent 7f3a8ae commit 39ab158
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 56 deletions.
40 changes: 0 additions & 40 deletions spec/acceptance/nginx_mail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,45 +79,5 @@ class { 'nginx':
describe port(465) do
it { is_expected.to be_listening }
end

context 'when configured for nginx 1.14' do
it 'runs successfully' do
pp = "
if fact('os.family') == 'RedHat' {
package { 'nginx-mod-mail':
ensure => installed,
}
}
class { 'nginx':
mail => true,
nginx_version => '1.14.0',
dynamic_modules => fact('os.family') ? {
'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'],
default => [],
}
}
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'localhost/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl => true,
ssl_port => 465,
ssl_cert => '/etc/pki/tls/certs/blah.cert',
ssl_key => '/etc/pki/tls/private/blah.key',
xclient => 'off',
}
"

apply_manifest(pp, catch_failures: true)
end

describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
it 'does\'t contain `ssl` on `listen` line' do
is_expected.to contain 'listen *:465;'
end
end
end
end
end
6 changes: 0 additions & 6 deletions spec/defines/resource_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,6 @@
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ ssl on;}) }
end

context 'with fact nginx_version=1.14.1' do
let(:facts) { facts.merge(nginx_version: '1.14.1') }

it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ ssl on;}) }
end

context 'with fact nginx_version=1.15.1' do
let(:facts) { facts.merge(nginx_version: '1.15.1') }

Expand Down
3 changes: 0 additions & 3 deletions templates/mailhost/mailhost.epp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ server {
<%- } -%>
<%= $mailhost_common -%>

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

<% if $starttls != 'off' { %>
Expand Down
5 changes: 1 addition & 4 deletions templates/mailhost/mailhost_ssl.epp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
server {
<%= $mailhost_prepend -%>
<%- $listen_ip.each |$ip| { -%>
listen <%= $ip %>:<%= $ssl_port %><% if versioncmp($nginx_version, '1.15.0') >= 0 { %> ssl<% } %>;
listen <%= $ip %>:<%= $ssl_port %> ssl;
<%- } -%>
<%- $ipv6_listen_ip.each |$ipv6| { -%>
listen [<%= $ipv6 %>]:<%= $ssl_port %> <% if $ipv6_listen_options { %><%= $ipv6_listen_options %><% } %>;
<%- } -%>
<%= $mailhost_common -%>

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

<%= $mailhost_ssl_settings -%>
Expand Down
3 changes: 0 additions & 3 deletions templates/server/server_ssl_settings.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.15.0']) < 0 -%>
ssl on;
<% end -%>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) >= 0 && @http2 -%>
http2 <%= @http2 %>;
<% end -%>
Expand Down

0 comments on commit 39ab158

Please sign in to comment.