Skip to content

Commit 2ec7463

Browse files
authored
Merge pull request #1473 from voxpupuli/fix-ci-centos
Fix CI on CentOS 7
2 parents b53f736 + 9e5eadc commit 2ec7463

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

spec/acceptance/init_spec.rb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
context 'default parameters' do
55
# Using puppet_apply as a helper
66
it 'works idempotently with no errors' do
7-
pp = 'include nginx'
7+
pp = "
8+
include nginx
9+
10+
nginx::resource::server { 'example.com':
11+
ensure => present,
12+
www_root => '/var/www/html',
13+
}
14+
"
815

916
# Run it twice and test for idempotency
1017
apply_manifest(pp, catch_failures: true)
@@ -35,7 +42,16 @@
3542
context 'with service_config_check true' do
3643
# Using puppet_apply as a helper
3744
it 'works idempotently with no errors' do
38-
pp = "class { 'nginx': service_config_check => true, }"
45+
pp = "
46+
class { 'nginx':
47+
service_config_check => true,
48+
}
49+
50+
nginx::resource::server { 'example.com':
51+
ensure => present,
52+
www_root => '/var/www/html',
53+
}
54+
"
3955

4056
# Run it twice and test for idempotency
4157
apply_manifest(pp, catch_failures: true)

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)