[COOK-4410] - Fix sender_canonical configuration by adding template and postmap execution

Signed-off-by: Sean OMeara <someara@opscode.com>
This commit is contained in:
Ian Neubert 2014-03-27 23:24:57 -04:00 committed by Sean OMeara
parent 39f1d1d474
commit 1c3f6981ee
2 changed files with 17 additions and 1 deletions

View File

@ -72,12 +72,18 @@ when 'omnios'
end end
end end
execute 'update-postfix-sender_canonical' do
command "postmap #{node['postfix']['conf_dir']}/sender_canonical"
action :nothing
end
if !node['postfix']['sender_canonical_map_entries'].empty? if !node['postfix']['sender_canonical_map_entries'].empty?
template "#{node['postfix']['conf_dir']}/sender_canonical" do template "#{node['postfix']['conf_dir']}/sender_canonical" do
owner 'root' owner 'root'
group 0 group 0
mode '0644' mode '0644'
notifies :restart, 'service[postfix]' notifies :run, 'execute[update-postfix-sender_canonical]'
notifies :reload, 'service[postfix]'
end end
if !node['postfix']['main'].key?('sender_canonical_maps') if !node['postfix']['main'].key?('sender_canonical_maps')

View File

@ -0,0 +1,10 @@
#
# This file is generated by Chef for <%= node['fqdn'] %>
#
# Local changes will be overwritten
#
# See man 5 canonical for format
<% node['postfix']['sender_canonical_map_entries'].each do |name, value| %>
<%= name %> <%= value %>
<% end unless node['postfix']['sender_canonical_map_entries'].nil? %>