Loading manifests/init.pp +39 −15 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ # # [*configs*] - (hash) # # [*hash*] - (hash) A hash of postfix::hash resources # [*hashes*] - (hash) A hash of postfix::hash resources # # [*transport*] - (hash) A hash of postfix::transport resources # [*transports*] - (hash) A hash of postfix::transport resources # # [*virtual*] - (hash) A hash of postfix::virtual resources # [*virtuals*] - (hash) A hash of postfix::virtual resources # # [*conffile*] - (hash) A hash of postfix::conffile resources # [*conffiles*] - (hash) A hash of postfix::conffile resources # # [*amavis_procs*] - (integer) Number of amavis scanners to spawn # Loading Loading @@ -106,11 +106,11 @@ class postfix ( Stdlib::Absolutepath $confdir = '/etc/postfix', String $root_group = 'root', String $alias_maps = 'hash:/etc/aliases', Optional[Hash] $configs = {}, Optional[Hash] $hash = {}, Optional[Hash] $transport = {}, Optional[Hash] $virtual = {}, Optional[Hash] $conffile = {}, Hash $configs = {}, Hash $hashes = {}, Hash $transports = {}, Hash $virtuals = {}, Hash $conffiles = {}, Integer $amavis_procs = 2, String $inet_interfaces = 'all', String $inet_protocols = 'all', Loading @@ -130,7 +130,7 @@ class postfix ( Optional[String] $master_smtp = undef, # postfix_master_smtp Optional[String] $master_smtps = undef, # postfix_master_smtps Optional[String] $master_submission = undef, # postfix_master_submission Optional[Array[String]] $master_entries = undef, # postfix_master_entries Array[String] $master_entries = [], # postfix_master_entries String $master_bounce_command = 'bounce', String $master_defer_command = 'bounce', Boolean $mta = false, Loading Loading @@ -170,11 +170,35 @@ class postfix ( true => "${alias_maps}, ldap:${confdir}/ldap-aliases.cf", } create_resources('::postfix::config', $configs) create_resources('::postfix::transport', $transport) create_resources('::postfix::virtual', $virtual) create_resources('::postfix::hash', $hash) create_resources('::postfix::conffile', $conffile) $configs.each |$key, $value| { postfix::config { $key: * => $value, } } $transports.each |$key, $value| { postfix::transport { $key: * => $value, } } $virtuals.each |$key, $value| { postfix::virtual { $key: * => $value, } } $hashes.each |$key, $value| { postfix::hash { $key: * => $value, } } $conffiles.each |$key, $value| { postfix::conffile { $key: * => $value, } } contain 'postfix::packages' contain 'postfix::files' Loading spec/classes/postfix_spec.rb +8 −8 Original line number Diff line number Diff line Loading @@ -490,10 +490,10 @@ describe 'postfix' do is_expected.to contain_postfix__config('message_size_limit').with_value('51200000') end end context 'when hash hash is used' do context 'when hashes hash is used' do let(:params) do { hash: { hashes: { '/etc/postfix/transport' => { 'ensure' => 'present', }, Loading @@ -505,10 +505,10 @@ describe 'postfix' do is_expected.to contain_postfix__hash('/etc/postfix/transport').with_ensure('present') end end context 'when transport hash is used' do context 'when transports hash is used' do let(:params) do { transport: { transports: { 'local_relay' => { 'nexthop' => '[10.12.0.2]:9925', }, Loading @@ -520,10 +520,10 @@ describe 'postfix' do is_expected.to contain_postfix__transport('local_relay').with_nexthop('[10.12.0.2]:9925') end end context 'when virtual hash is used' do context 'when virtuals hash is used' do let(:params) do { virtual: { virtuals: { 'someone@somedomain.tld' => { 'destination' => 'internal@ourdomain.tld', }, Loading @@ -535,10 +535,10 @@ describe 'postfix' do is_expected.to contain_postfix__virtual('someone@somedomain.tld').with_destination('internal@ourdomain.tld') end end context 'when conffile hash is used' do context 'when conffiles hash is used' do let(:params) do { conffile: { conffiles: { 'ldapoptions.cf' => { 'mode' => '0640', 'options' => { Loading templates/master.cf.common.erb +0 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,4 @@ sympa unix - n n - - pipe sympabounce unix - n n - - pipe flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} <% end -%> <% if @master_entries %> <%= @master_entries.join("\n") %> <% end -%> Loading
manifests/init.pp +39 −15 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ # # [*configs*] - (hash) # # [*hash*] - (hash) A hash of postfix::hash resources # [*hashes*] - (hash) A hash of postfix::hash resources # # [*transport*] - (hash) A hash of postfix::transport resources # [*transports*] - (hash) A hash of postfix::transport resources # # [*virtual*] - (hash) A hash of postfix::virtual resources # [*virtuals*] - (hash) A hash of postfix::virtual resources # # [*conffile*] - (hash) A hash of postfix::conffile resources # [*conffiles*] - (hash) A hash of postfix::conffile resources # # [*amavis_procs*] - (integer) Number of amavis scanners to spawn # Loading Loading @@ -106,11 +106,11 @@ class postfix ( Stdlib::Absolutepath $confdir = '/etc/postfix', String $root_group = 'root', String $alias_maps = 'hash:/etc/aliases', Optional[Hash] $configs = {}, Optional[Hash] $hash = {}, Optional[Hash] $transport = {}, Optional[Hash] $virtual = {}, Optional[Hash] $conffile = {}, Hash $configs = {}, Hash $hashes = {}, Hash $transports = {}, Hash $virtuals = {}, Hash $conffiles = {}, Integer $amavis_procs = 2, String $inet_interfaces = 'all', String $inet_protocols = 'all', Loading @@ -130,7 +130,7 @@ class postfix ( Optional[String] $master_smtp = undef, # postfix_master_smtp Optional[String] $master_smtps = undef, # postfix_master_smtps Optional[String] $master_submission = undef, # postfix_master_submission Optional[Array[String]] $master_entries = undef, # postfix_master_entries Array[String] $master_entries = [], # postfix_master_entries String $master_bounce_command = 'bounce', String $master_defer_command = 'bounce', Boolean $mta = false, Loading Loading @@ -170,11 +170,35 @@ class postfix ( true => "${alias_maps}, ldap:${confdir}/ldap-aliases.cf", } create_resources('::postfix::config', $configs) create_resources('::postfix::transport', $transport) create_resources('::postfix::virtual', $virtual) create_resources('::postfix::hash', $hash) create_resources('::postfix::conffile', $conffile) $configs.each |$key, $value| { postfix::config { $key: * => $value, } } $transports.each |$key, $value| { postfix::transport { $key: * => $value, } } $virtuals.each |$key, $value| { postfix::virtual { $key: * => $value, } } $hashes.each |$key, $value| { postfix::hash { $key: * => $value, } } $conffiles.each |$key, $value| { postfix::conffile { $key: * => $value, } } contain 'postfix::packages' contain 'postfix::files' Loading
spec/classes/postfix_spec.rb +8 −8 Original line number Diff line number Diff line Loading @@ -490,10 +490,10 @@ describe 'postfix' do is_expected.to contain_postfix__config('message_size_limit').with_value('51200000') end end context 'when hash hash is used' do context 'when hashes hash is used' do let(:params) do { hash: { hashes: { '/etc/postfix/transport' => { 'ensure' => 'present', }, Loading @@ -505,10 +505,10 @@ describe 'postfix' do is_expected.to contain_postfix__hash('/etc/postfix/transport').with_ensure('present') end end context 'when transport hash is used' do context 'when transports hash is used' do let(:params) do { transport: { transports: { 'local_relay' => { 'nexthop' => '[10.12.0.2]:9925', }, Loading @@ -520,10 +520,10 @@ describe 'postfix' do is_expected.to contain_postfix__transport('local_relay').with_nexthop('[10.12.0.2]:9925') end end context 'when virtual hash is used' do context 'when virtuals hash is used' do let(:params) do { virtual: { virtuals: { 'someone@somedomain.tld' => { 'destination' => 'internal@ourdomain.tld', }, Loading @@ -535,10 +535,10 @@ describe 'postfix' do is_expected.to contain_postfix__virtual('someone@somedomain.tld').with_destination('internal@ourdomain.tld') end end context 'when conffile hash is used' do context 'when conffiles hash is used' do let(:params) do { conffile: { conffiles: { 'ldapoptions.cf' => { 'mode' => '0640', 'options' => { Loading
templates/master.cf.common.erb +0 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,4 @@ sympa unix - n n - - pipe sympabounce unix - n n - - pipe flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} <% end -%> <% if @master_entries %> <%= @master_entries.join("\n") %> <% end -%>