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
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -47,7 +47,11 @@ define postfix::map (
  if $type =~ /^(cidr|pcre)$/ {
    $manage_notify = Service['postfix']
  } else {
    if $ensure == 'present' {
      $manage_notify = Exec["generate ${name}.db"]
    } else {
      $manage_notify = undef
    }
  }

  file { "postfix map ${name}":
+1 −0
Original line number Diff line number Diff line
@@ -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