Commit c8253b6e authored by treydock's avatar treydock Committed by Raphaël Pinson
Browse files

Do not generate postmap when postfix::map ensure is absent (#178)

parent 8bc88588
......@@ -47,7 +47,11 @@ define postfix::map (
if $type =~ /^(cidr|pcre)$/ {
$manage_notify = Service['postfix']
} else {
$manage_notify = Exec["generate ${name}.db"]
if $ensure == 'present' {
$manage_notify = Exec["generate ${name}.db"]
} else {
$manage_notify = undef
}
}
file { "postfix map ${name}":
......
......@@ -91,6 +91,7 @@ describe 'postfix::map' do
} }
it { is_expected.to contain_file('postfix map foo').with_ensure('absent') }
it { is_expected.to contain_file('postfix map foo').without_notify }
it { is_expected.to contain_file('postfix map foo.db').with_ensure('absent') }
it { is_expected.to contain_exec('generate foo.db') }
end
......
Markdown is supported
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