Cookstyle fixes

Signed-off-by: Tim Smith <tsmith@chef.io>
This commit is contained in:
Tim Smith 2019-01-20 11:45:35 -08:00
parent 5428c4f171
commit 684b407157
4 changed files with 27 additions and 55 deletions

View File

@ -401,6 +401,4 @@ default['postfix']['aliases'] = case node['platform']
{} {}
end end
if node['postfix']['use_relay_restrictions_maps'] default['postfix']['main']['smtpd_relay_restrictions'] = "hash:#{node['postfix']['relay_restrictions_db']}, reject" if node['postfix']['use_relay_restrictions_maps']
default['postfix']['main']['smtpd_relay_restrictions'] = "hash:#{node['postfix']['relay_restrictions_db']}, reject"
end

View File

@ -13,9 +13,7 @@
# limitations under the License. # limitations under the License.
# #
if node['postfix']['use_procmail'] node.default_unless['postfix']['main']['mailbox_command'] = '/usr/bin/procmail -a "$EXTENSION"' if node['postfix']['use_procmail']
node.default_unless['postfix']['main']['mailbox_command'] = '/usr/bin/procmail -a "$EXTENSION"'
end
if node['postfix']['main']['smtpd_use_tls'] == 'yes' if node['postfix']['main']['smtpd_use_tls'] == 'yes'
node.default_unless['postfix']['main']['smtpd_tls_cert_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem' node.default_unless['postfix']['main']['smtpd_tls_cert_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
@ -38,34 +36,18 @@ if node['postfix']['main']['smtp_sasl_auth_enable'] == 'yes'
node.default_unless['postfix']['main']['relayhost'] = '' node.default_unless['postfix']['main']['relayhost'] = ''
end end
if node['postfix']['use_alias_maps'] node.default_unless['postfix']['main']['alias_maps'] = ["hash:#{node['postfix']['aliases_db']}"] if node['postfix']['use_alias_maps']
node.default_unless['postfix']['main']['alias_maps'] = ["hash:#{node['postfix']['aliases_db']}"]
end
if node['postfix']['use_transport_maps'] node.default_unless['postfix']['main']['transport_maps'] = ["hash:#{node['postfix']['transport_db']}"] if node['postfix']['use_transport_maps']
node.default_unless['postfix']['main']['transport_maps'] = ["hash:#{node['postfix']['transport_db']}"]
end
if node['postfix']['use_access_maps'] node.default_unless['postfix']['main']['access_maps'] = ["hash:#{node['postfix']['access_db']}"] if node['postfix']['use_access_maps']
node.default_unless['postfix']['main']['access_maps'] = ["hash:#{node['postfix']['access_db']}"]
end
if node['postfix']['use_virtual_aliases'] node.default_unless['postfix']['main']['virtual_alias_maps'] = ["#{node['postfix']['virtual_alias_db_type']}:#{node['postfix']['virtual_alias_db']}"] if node['postfix']['use_virtual_aliases']
node.default_unless['postfix']['main']['virtual_alias_maps'] = ["#{node['postfix']['virtual_alias_db_type']}:#{node['postfix']['virtual_alias_db']}"]
end
if node['postfix']['use_virtual_aliases_domains'] node.default_unless['postfix']['main']['virtual_alias_domains'] = ["#{node['postfix']['virtual_alias_domains_db_type']}:#{node['postfix']['virtual_alias_domains_db']}"] if node['postfix']['use_virtual_aliases_domains']
node.default_unless['postfix']['main']['virtual_alias_domains'] = ["#{node['postfix']['virtual_alias_domains_db_type']}:#{node['postfix']['virtual_alias_domains_db']}"]
end
if node['postfix']['use_relay_restrictions_maps'] node.default_unless['postfix']['main']['smtpd_relay_restrictions'] = "hash:#{node['postfix']['relay_restrictions_db']}, reject" if node['postfix']['use_relay_restrictions_maps']
node.default_unless['postfix']['main']['smtpd_relay_restrictions'] = "hash:#{node['postfix']['relay_restrictions_db']}, reject"
end
if node['postfix']['master']['maildrop']['active'] node.default_unless['postfix']['main']['maildrop_destination_recipient_limit'] = 1 if node['postfix']['master']['maildrop']['active']
node.default_unless['postfix']['main']['maildrop_destination_recipient_limit'] = 1
end
if node['postfix']['master']['cyrus']['active'] node.default_unless['postfix']['main']['cyrus_destination_recipient_limit'] = 1 if node['postfix']['master']['cyrus']['active']
node.default_unless['postfix']['main']['cyrus_destination_recipient_limit'] = 1
end

View File

@ -126,9 +126,7 @@ unless node['postfix']['sender_canonical_map_entries'].empty?
notifies :reload, 'service[postfix]' notifies :reload, 'service[postfix]'
end end
unless node['postfix']['main'].key?('sender_canonical_maps') node.normal['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical" unless node['postfix']['main'].key?('sender_canonical_maps')
node.normal['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical"
end
end end
execute 'update-postfix-smtp_generic' do execute 'update-postfix-smtp_generic' do
@ -145,9 +143,7 @@ unless node['postfix']['smtp_generic_map_entries'].empty?
notifies :reload, 'service[postfix]' notifies :reload, 'service[postfix]'
end end
unless node['postfix']['main'].key?('smtp_generic_maps') node.normal['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic" unless node['postfix']['main'].key?('smtp_generic_maps')
node.normal['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic"
end
end end
execute 'update-postfix-recipient_canonical' do execute 'update-postfix-recipient_canonical' do
@ -164,9 +160,7 @@ unless node['postfix']['recipient_canonical_map_entries'].empty?
notifies :reload, 'service[postfix]' notifies :reload, 'service[postfix]'
end end
unless node['postfix']['main'].key?('recipient_canonical_maps') node.normal['postfix']['main']['recipient_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/recipient_canonical" unless node['postfix']['main'].key?('recipient_canonical_maps')
node.normal['postfix']['main']['recipient_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/recipient_canonical"
end
end end
%w( main master ).each do |cfg| %w( main master ).each do |cfg|

View File

@ -38,9 +38,7 @@ node['postfix']['maps'].each do |type, maps|
map: content, map: content,
separator: separator separator: separator
) )
if %w(btree cdb dbm hash sdbm).include?(type) notifies :run, "execute[update-postmap-#{file}]" if %w(btree cdb dbm hash sdbm).include?(type)
notifies :run, "execute[update-postmap-#{file}]"
end
notifies :restart, 'service[postfix]' notifies :restart, 'service[postfix]'
end end
end end