Skip to content

Commit 9e5eadc

Browse files
committed
Fix mail configuration for CI on CentOS
CentOS has a nginx-mod-mail package which should be installed when configuring nginx to process mail. On Debian, such packages are installed by the module and auto-lodaded but this mechanism is not in place for CentOS so we have to do it explicitely.
1 parent 1232c18 commit 9e5eadc

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

spec/acceptance/nginx_mail_spec.rb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33
describe 'nginx::resource::mailhost define:' do
44
it 'runs successfully' do
55
pp = "
6+
if fact('os.family') == 'RedHat' {
7+
package { 'nginx-mod-mail':
8+
ensure => installed,
9+
}
10+
}
11+
612
class { 'nginx':
7-
mail => true,
13+
mail => true,
14+
dynamic_modules => fact('os.family') ? {
15+
'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'],
16+
default => [],
17+
}
818
}
919
nginx::resource::mailhost { 'domain1.example':
1020
ensure => present,
@@ -39,9 +49,19 @@ class { 'nginx':
3949
context 'when configured for nginx 1.14' do
4050
it 'runs successfully' do
4151
pp = "
52+
if fact('os.family') == 'RedHat' {
53+
package { 'nginx-mod-mail':
54+
ensure => installed,
55+
}
56+
}
57+
4258
class { 'nginx':
43-
mail => true,
44-
nginx_version => '1.14.0',
59+
mail => true,
60+
nginx_version => '1.14.0',
61+
dynamic_modules => fact('os.family') ? {
62+
'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'],
63+
default => [],
64+
}
4565
}
4666
nginx::resource::mailhost { 'domain1.example':
4767
ensure => present,

0 commit comments

Comments
 (0)