Skip to content

Commit 3dfc20c

Browse files
committed
Disable creating a mail relay for nginx 1.14
There's no clean way to test it, and the tests are broken in a whole lot of ways. With the nginx repo available for 1.28, remove the ability to use the 1.14 package for the mailhost resource. Fix arch package names
1 parent 66b1781 commit 3dfc20c

File tree

4 files changed

+4
-37
lines changed

4 files changed

+4
-37
lines changed

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
'log_user' => 'http',
112112
'log_group' => 'log',
113113
'package_name' => 'nginx-mainline',
114-
'mail_package_name' => 'nginx-mod-mail',
114+
'mail_package_name' => 'nginx-mainline-mod-mail',
115115
}
116116
}
117117
'Debian': {

manifests/resource/mailhost.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@
187187
) {
188188
if ! defined(Class['nginx']) {
189189
fail('You must include the nginx base class before using any defined resources')
190+
} elsif versioncmp($facts.get('nginx_version', $nginx::nginx_version), '1.15.0') < 0 {
191+
fail('This module does not support nginx 1.14')
190192
}
191193
if $nginx::mail_package_name {
192194
package { $nginx::mail_package_name:

spec/acceptance/nginx_mail_spec.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,5 @@ class { 'nginx':
6565
describe port(465) do
6666
it { is_expected.to be_listening }
6767
end
68-
69-
context 'when configured for nginx 1.14', if: !%w[Debian Archlinux].include?(fact('os.family')) do
70-
shell('yum -y install nginx-1.14.1') if fact('os.family') == 'RedHat' && fact('os.release.major') == '8'
71-
it 'runs successfully' do
72-
pp = "
73-
class { 'nginx':
74-
mail => true,
75-
manage_repo => false,
76-
nginx_version => '1.14.0',
77-
}
78-
nginx::resource::mailhost { 'domain1.example':
79-
ensure => present,
80-
auth_http => 'localhost/cgi-bin/auth',
81-
protocol => 'smtp',
82-
listen_port => 587,
83-
ssl => true,
84-
ssl_port => 465,
85-
ssl_cert => '/etc/pki/tls/certs/blah.cert',
86-
ssl_key => '/etc/pki/tls/private/blah.key',
87-
xclient => 'off',
88-
}
89-
"
90-
91-
apply_manifest(pp, catch_failures: true)
92-
end
93-
94-
describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
95-
it 'does\'t contain `ssl` on `listen` line' do
96-
is_expected.to contain 'listen *:465;'
97-
end
98-
end
99-
end
10068
end
10169
end

templates/mailhost/mailhost_ssl.epp

Lines changed: 1 addition & 4 deletions
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 -%>

0 commit comments

Comments
 (0)