Loading manifests/files.pp +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class postfix::files { content => "# file managed by puppet\n", notify => Exec['newaliases'], replace => false, seltype => $postfix::params::seltype, seltype => $postfix::params::aliasesseltype, } # Aliases Loading manifests/params.pp +7 −0 Original line number Diff line number Diff line class postfix::params { case $::osfamily { 'RedHat': { $aliasesseltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', /5/ => 'postfix_etc_t', /6|7/ => 'etc_aliases_t', default => undef, } $seltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', /5|6|7/ => 'postfix_etc_t', Loading spec/classes/postfix_spec.rb +11 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ describe 'postfix' do ) } else it { is_expected.to contain_file('/etc/mailname').with_seltype('postfix_etc_t').with_content("foo.example.com\n") } it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } it { is_expected.to contain_file('/etc/postfix/master.cf').with_seltype('postfix_etc_t') } it { is_expected.to contain_file('/etc/postfix/main.cf').with_seltype('postfix_etc_t') } Loading @@ -45,6 +44,7 @@ describe 'postfix' do case facts[:operatingsystemmajrelease] 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_service('postfix').with( :ensure => 'running', Loading @@ -52,7 +52,17 @@ describe 'postfix' do :hasstatus => 'true', :restart => '/bin/systemctl reload postfix' ) } when '6' 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 => '/etc/init.d/postfix reload' ) } else it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } it { is_expected.to contain_service('postfix').with( :ensure => 'running', Loading Loading
manifests/files.pp +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class postfix::files { content => "# file managed by puppet\n", notify => Exec['newaliases'], replace => false, seltype => $postfix::params::seltype, seltype => $postfix::params::aliasesseltype, } # Aliases Loading
manifests/params.pp +7 −0 Original line number Diff line number Diff line class postfix::params { case $::osfamily { 'RedHat': { $aliasesseltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', /5/ => 'postfix_etc_t', /6|7/ => 'etc_aliases_t', default => undef, } $seltype = $::operatingsystemmajrelease ? { '4' => 'etc_t', /5|6|7/ => 'postfix_etc_t', Loading
spec/classes/postfix_spec.rb +11 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ describe 'postfix' do ) } else it { is_expected.to contain_file('/etc/mailname').with_seltype('postfix_etc_t').with_content("foo.example.com\n") } it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } it { is_expected.to contain_file('/etc/postfix/master.cf').with_seltype('postfix_etc_t') } it { is_expected.to contain_file('/etc/postfix/main.cf').with_seltype('postfix_etc_t') } Loading @@ -45,6 +44,7 @@ describe 'postfix' do case facts[:operatingsystemmajrelease] 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_service('postfix').with( :ensure => 'running', Loading @@ -52,7 +52,17 @@ describe 'postfix' do :hasstatus => 'true', :restart => '/bin/systemctl reload postfix' ) } when '6' 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 => '/etc/init.d/postfix reload' ) } else it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } it { is_expected.to contain_service('postfix').with( :ensure => 'running', Loading