From 61dc9d0f8ce36262c863f24d152829736ad2ebfe Mon Sep 17 00:00:00 2001 From: "Jehle, Nicolas" Date: Tue, 13 Aug 2019 10:43:49 +0000 Subject: [PATCH] Add RedHat 8 support --- manifests/params.pp | 6 +++--- metadata.json | 3 ++- spec/classes/postfix_spec.rb | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index ba3e0491..be6222cc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,18 +4,18 @@ $aliasesseltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', /5/ => 'postfix_etc_t', - /6|7/ => 'etc_aliases_t', + /6|7|8/ => 'etc_aliases_t', default => undef, } $seltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', - /5|6|7/ => 'postfix_etc_t', + /5|6|7|8/ => 'postfix_etc_t', default => undef, } $restart_cmd = $::operatingsystemmajrelease ? { - '7' => '/bin/systemctl reload postfix', + /7|8/ => '/bin/systemctl reload postfix', default => '/etc/init.d/postfix reload', } diff --git a/metadata.json b/metadata.json index c6a669a9..a6a99a83 100644 --- a/metadata.json +++ b/metadata.json @@ -50,7 +50,8 @@ "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { diff --git a/spec/classes/postfix_spec.rb b/spec/classes/postfix_spec.rb index 452054b1..63255cfe 100644 --- a/spec/classes/postfix_spec.rb +++ b/spec/classes/postfix_spec.rb @@ -45,6 +45,15 @@ it { is_expected.to contain_postfix__config('mailq_path') } 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' it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it {