Commit 44b4a00b authored by zeromind's avatar zeromind Committed by Raphaël Pinson
Browse files

Add RedHat 8 support (#257)

parent 6e6c6c96
...@@ -4,18 +4,18 @@ class postfix::params { ...@@ -4,18 +4,18 @@ class postfix::params {
$aliasesseltype = $::operatingsystemmajrelease ? { $aliasesseltype = $::operatingsystemmajrelease ? {
'4' => 'etc_t', '4' => 'etc_t',
/5/ => 'postfix_etc_t', /5/ => 'postfix_etc_t',
/6|7/ => 'etc_aliases_t', /6|7|8/ => 'etc_aliases_t',
default => undef, default => undef,
} }
$seltype = $::operatingsystemmajrelease ? { $seltype = $::operatingsystemmajrelease ? {
'4' => 'etc_t', '4' => 'etc_t',
/5|6|7/ => 'postfix_etc_t', /5|6|7|8/ => 'postfix_etc_t',
default => undef, default => undef,
} }
$restart_cmd = $::operatingsystemmajrelease ? { $restart_cmd = $::operatingsystemmajrelease ? {
'7' => '/bin/systemctl reload postfix', /7|8/ => '/bin/systemctl reload postfix',
default => '/etc/init.d/postfix reload', default => '/etc/init.d/postfix reload',
} }
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
"operatingsystem": "RedHat", "operatingsystem": "RedHat",
"operatingsystemrelease": [ "operatingsystemrelease": [
"6", "6",
"7" "7",
"8"
] ]
}, },
{ {
......
...@@ -45,6 +45,15 @@ describe 'postfix' do ...@@ -45,6 +45,15 @@ describe 'postfix' do
it { is_expected.to contain_postfix__config('mailq_path') } it { is_expected.to contain_postfix__config('mailq_path') }
case facts[:operatingsystemmajrelease] case facts[:operatingsystemmajrelease]
when '8'
it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") }
it {
is_expected.to contain_service('postfix').with(
:ensure => 'running',
:enable => 'true',
:hasstatus => 'true',
:restart => '/bin/systemctl reload postfix'
) }
when '7' when '7'
it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") }
it { it {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment