Fork the postfix cookbook to work around a bug

I ran into the issue described in
https://github.com/sous-chefs/postfix/issues/148
and couldn't figure out a way to work around it without forking it.
This commit is contained in:
Greg Karekinian
2025-09-09 14:54:06 +02:00
parent d32f276b42
commit 9712697569
13 changed files with 97 additions and 32 deletions

View File

@@ -18,8 +18,8 @@ node['postfix']['maps'].each do |type, maps|
package "postfix-#{type}" if %w(pgsql mysql ldap cdb).include?(type)
end
if platform?('redhat') && node['platform_version'].to_i == 8
package "postfix-#{type}" if %w(pgsql mysql ldap cdb).include?(type)
if platform_family?('rhel') && node['platform_version'].to_i >= 8
package "postfix-#{type}" if %w(pgsql mysql ldap cdb lmdb).include?(type)
end
separator = if %w(pgsql mysql ldap memcache sqlite).include?(type)
@@ -32,7 +32,7 @@ node['postfix']['maps'].each do |type, maps|
command "postmap #{file}"
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
action :nothing
end if %w(btree cdb dbm hash sdbm).include?(type)
end if %w(btree cdb dbm hash lmdb sdbm).include?(type)
template "#{file}-#{type}" do
path file
source 'maps.erb'
@@ -41,7 +41,7 @@ node['postfix']['maps'].each do |type, maps|
map: content,
separator: separator
)
notifies :run, "execute[update-postmap-#{file}]" if %w(btree cdb dbm hash sdbm).include?(type)
notifies :run, "execute[update-postmap-#{file}]" if %w(btree cdb dbm hash lmdb sdbm).include?(type)
notifies :restart, 'service[postfix]'
end
end