Loading manifests/map.pp +8 −8 Original line number Diff line number Diff line Loading @@ -29,11 +29,11 @@ # define postfix::map ( Enum['present', 'absent'] $ensure = 'present', Variant[Array[String], String, Undef] $source = undef, Optional[Variant[Array[String], String]] $source = undef, Optional[Variant[Sensitive[String], String]] $content = undef, String $type = 'hash', String[1] $type = 'hash', Optional[Stdlib::Absolutepath] $path = undef, String[4,4] $mode = '0640' String[4,4] $mode = '0640', ) { include postfix include postfix::params Loading @@ -49,7 +49,7 @@ define postfix::map ( } # CIDR and PCRE maps need a postfix reload, but not a postmap if $type =~ /^(cidr|pcre)$/ { if $type =~ /^(cidr|pcre|regexp)$/ { $manage_notify = Service['postfix'] } else { if $ensure == 'present' { Loading @@ -71,7 +71,7 @@ define postfix::map ( notify => $manage_notify, } if $type !~ /^(cidr|pcre)$/ { if $type !~ /^(cidr|pcre|regexp)$/ { file { "postfix map ${name}.db": ensure => $ensure, path => "${_path}.db", Loading spec/defines/postfix_map_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,17 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with_ensure('present') } it { is_expected.not_to contain_file('postfix map foo.db') } end context 'when using regexp type' do let(:params) do { type: 'regexp', } end it { is_expected.to contain_file('postfix map foo').with_ensure('present') } it { is_expected.not_to contain_file('postfix map foo.db') } end end end end Loading
manifests/map.pp +8 −8 Original line number Diff line number Diff line Loading @@ -29,11 +29,11 @@ # define postfix::map ( Enum['present', 'absent'] $ensure = 'present', Variant[Array[String], String, Undef] $source = undef, Optional[Variant[Array[String], String]] $source = undef, Optional[Variant[Sensitive[String], String]] $content = undef, String $type = 'hash', String[1] $type = 'hash', Optional[Stdlib::Absolutepath] $path = undef, String[4,4] $mode = '0640' String[4,4] $mode = '0640', ) { include postfix include postfix::params Loading @@ -49,7 +49,7 @@ define postfix::map ( } # CIDR and PCRE maps need a postfix reload, but not a postmap if $type =~ /^(cidr|pcre)$/ { if $type =~ /^(cidr|pcre|regexp)$/ { $manage_notify = Service['postfix'] } else { if $ensure == 'present' { Loading @@ -71,7 +71,7 @@ define postfix::map ( notify => $manage_notify, } if $type !~ /^(cidr|pcre)$/ { if $type !~ /^(cidr|pcre|regexp)$/ { file { "postfix map ${name}.db": ensure => $ensure, path => "${_path}.db", Loading
spec/defines/postfix_map_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,17 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with_ensure('present') } it { is_expected.not_to contain_file('postfix map foo.db') } end context 'when using regexp type' do let(:params) do { type: 'regexp', } end it { is_expected.to contain_file('postfix map foo').with_ensure('present') } it { is_expected.not_to contain_file('postfix map foo.db') } end end end end