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

Fix virtual.db and transport.db creation (#135)

May address #130
parent ba2945fe
Loading
Loading
Loading
Loading
+6 −0
Changes for manifests/hash.pp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -70,6 +70,12 @@ define postfix::hash (
  }

  exec {"generate ${name}.db":
    command => "postmap ${name}",
    path    => $::path,
    creates => "${name}.db", # this prevents postmap from being run !
    require => File[$name],
  }
  exec {"regenerate ${name}.db":
    command     => "postmap ${name}",
    path        => $::path,
    #creates    => "${name}.db", # this prevents postmap from being run !
+4 −0
Changes for spec/defines/postfix_hash_spec.rb: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ describe 'postfix::hash' do
        }
        it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') }
        it { is_expected.to contain_exec('generate /tmp/foo.db') }
        it { is_expected.to contain_exec('regenerate /tmp/foo.db') }
      end

      context 'when passing content' do
@@ -83,6 +84,7 @@ describe 'postfix::hash' do
        }
        it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') }
        it { is_expected.to contain_exec('generate /tmp/foo.db') }
        it { is_expected.to contain_exec('regenerate /tmp/foo.db') }
      end

      context 'when not passing source or content' do
@@ -92,6 +94,7 @@ describe 'postfix::hash' do
        }
        it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') }
        it { is_expected.to contain_exec('generate /tmp/foo.db') }
        it { is_expected.to contain_exec('regenerate /tmp/foo.db') }
      end

      context 'when ensuring absence' do
@@ -102,6 +105,7 @@ describe 'postfix::hash' do
        it { is_expected.to contain_file('/tmp/foo').with_ensure('absent') }
        it { is_expected.to contain_file('/tmp/foo.db').with_ensure('absent') }
        it { is_expected.to contain_exec('generate /tmp/foo.db') }
        it { is_expected.to contain_exec('regenerate /tmp/foo.db') }
      end
    end
  end