Loading manifests/init.pp +9 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ # # [*conffiles*] - (hash) A hash of postfix::conffile resources # # [*maps*] - (hash) A hash of postfix::map resources # # [*amavis_procs*] - (integer) Number of amavis scanners to spawn # # [*inet_interfaces*] - (string) Loading Loading @@ -111,6 +113,7 @@ class postfix ( Hash $transports = {}, Hash $virtuals = {}, Hash $conffiles = {}, Hash $maps = {}, Integer $amavis_procs = 2, String $inet_interfaces = 'all', String $inet_protocols = 'all', Loading Loading @@ -200,6 +203,12 @@ class postfix ( } } $maps.each |$key, $value| { postfix::map { $key: * => $value, } } contain 'postfix::packages' contain 'postfix::files' contain 'postfix::service' Loading spec/classes/postfix_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,25 @@ describe 'postfix' do ) end end context 'when maps hash is used' do let(:params) do { maps: { 'a_map' => { 'type' => 'regexp', 'content' => 'abc xyz', }, }, } end it 'creates the map resource' do is_expected.to contain_postfix__map('a_map').with( 'type' => 'regexp', 'content' => 'abc xyz' ) end end end end end Loading Loading
manifests/init.pp +9 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ # # [*conffiles*] - (hash) A hash of postfix::conffile resources # # [*maps*] - (hash) A hash of postfix::map resources # # [*amavis_procs*] - (integer) Number of amavis scanners to spawn # # [*inet_interfaces*] - (string) Loading Loading @@ -111,6 +113,7 @@ class postfix ( Hash $transports = {}, Hash $virtuals = {}, Hash $conffiles = {}, Hash $maps = {}, Integer $amavis_procs = 2, String $inet_interfaces = 'all', String $inet_protocols = 'all', Loading Loading @@ -200,6 +203,12 @@ class postfix ( } } $maps.each |$key, $value| { postfix::map { $key: * => $value, } } contain 'postfix::packages' contain 'postfix::files' contain 'postfix::service' Loading
spec/classes/postfix_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,25 @@ describe 'postfix' do ) end end context 'when maps hash is used' do let(:params) do { maps: { 'a_map' => { 'type' => 'regexp', 'content' => 'abc xyz', }, }, } end it 'creates the map resource' do is_expected.to contain_postfix__map('a_map').with( 'type' => 'regexp', 'content' => 'abc xyz' ) end end end end end Loading