|
5 | 5 | describe 'nginx::resource::mailhost define:' do |
6 | 6 | has_recent_mail_module = true |
7 | 7 |
|
8 | | - if fact('os.family') == 'RedHat' && fact('os.release.major') == '8' |
9 | | - # EPEL had recent nginx-mod-mail package for CentOS 7 but not CentOS 8 |
10 | | - # Stream. The base packages use an older version of nginx that does not |
11 | | - # work with the acceptance test configuration. |
12 | | - has_recent_mail_module = false |
13 | | - end |
| 8 | + has_recent_mail_module = false if fact('os.family') == 'RedHat' && fact('os.release.major') == '8' |
14 | 9 |
|
15 | 10 | it 'remove leftovers from previous tests', if: fact('os.family') == 'RedHat' do |
16 | | - shell('yum -y remove nginx nginx-filesystem passenger') |
17 | 11 | # nginx-mod-mail is not available for all versions of nginx, the one |
18 | 12 | # installed might be incompatible with the version of nginx-mod-mail we are |
19 | 13 | # about to install so clean everything. |
|
26 | 20 | } |
27 | 21 | " |
28 | 22 | apply_manifest(pp, catch_failures: true) |
| 23 | + shell('yum -y remove nginx nginx-filesystem passenger nginx-mod-mail') |
| 24 | + shell('yum clean all') |
29 | 25 | end |
30 | 26 |
|
31 | 27 | context 'actualy test the mail module', if: has_recent_mail_module do |
32 | 28 | it 'runs successfully' do |
33 | 29 | pp = " |
34 | | - if fact('os.family') == 'RedHat' { |
35 | | - package { 'nginx-mod-mail': |
36 | | - ensure => installed, |
37 | | - } |
38 | | - } |
39 | | -
|
40 | 30 | class { 'nginx': |
41 | 31 | mail => true, |
42 | | - dynamic_modules => fact('os.family') ? { |
43 | | - 'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'], |
44 | | - default => [], |
45 | | - } |
46 | 32 | } |
47 | 33 | nginx::resource::mailhost { 'domain1.example': |
48 | 34 | ensure => present, |
@@ -81,21 +67,13 @@ class { 'nginx': |
81 | 67 | end |
82 | 68 |
|
83 | 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' |
84 | 71 | it 'runs successfully' do |
85 | 72 | pp = " |
86 | | - if fact('os.family') == 'RedHat' { |
87 | | - package { 'nginx-mod-mail': |
88 | | - ensure => installed, |
89 | | - } |
90 | | - } |
91 | | -
|
92 | 73 | class { 'nginx': |
93 | 74 | mail => true, |
| 75 | + manage_repo => false, |
94 | 76 | 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 | 77 | } |
100 | 78 | nginx::resource::mailhost { 'domain1.example': |
101 | 79 | ensure => present, |
|
0 commit comments