Skip to content

Commit

Permalink
Merge pull request voxpupuli#1395 from wtfo-guru/support_absent_mailh…
Browse files Browse the repository at this point in the history
…osts

Actually use the ensure parameter for mailhost resource to provide absent support
  • Loading branch information
ekohl authored Jul 17, 2020
2 parents 27b61fb + 20da819 commit d8fe092
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifests/resource/mailhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
}

concat { $config_file:
ensure => $ensure,
owner => 'root',
group => $root_group,
mode => $nginx::global_mode,
Expand Down
7 changes: 7 additions & 0 deletions spec/defines/resource_mailhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
it { is_expected.not_to contain_concat__fragment("#{title}-ssl") }
end

describe 'absent assumption' do
let(:params) { default_params.merge('ensure'.to_sym => 'absent') }

it { is_expected.to contain_class('nginx') }
it { is_expected.to contain_concat("/etc/nginx/conf.mail.d/#{title}.conf").with('ensure' => 'absent') }
end

describe 'mailhost template content' do
[
{
Expand Down

0 comments on commit d8fe092

Please sign in to comment.