-
-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
During testing of a wrapper cookbook, we very quickly noticed that if the .db files corresponding to a postfix table are deleted, they are not replaced unless the content of the table file is changed, which triggers execution of postmap again.
Obviously, nothing should be deleting these files but this makes it really difficult to ensure consistency of the state declared by the cookbook.
There's a simple fix - in the recipes for the various files, like transport.rb, instead of:
execute 'update-postfix-transport' do
command "postmap #{node['postfix']['transport_db']}"
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
action :nothing
endIt could be:
execute 'update-postfix-transport' do
command "postmap #{node['postfix']['transport_db']}"
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
action File.exist?("#{node['postfix']['transport_db'].db") ? :nothing : :run
endWhich maintains all the current behavior but also runs postmap if the db file is missing.
Thanks
Metadata
Metadata
Assignees
Labels
No labels