Skip to content

Commit

Permalink
fb_postfix: specify map type when rebuilding aliases too
Browse files Browse the repository at this point in the history
Differential Revision: D54362650

fbshipit-source-id: 7b0cc6b54fd9fe005e62f5f9b3a3d08f4e2b5612
  • Loading branch information
davide125 authored and facebook-github-bot committed Feb 29, 2024
1 parent e7b446b commit 344da65
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cookbooks/fb_postfix/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@
end
end

# RHEL 10 and later don't support hash maps anymore
# https://src.fedoraproject.org/rpms/postfix/c/6a2621e4d73d59337dc64ba45922132286b841a1
if node.el_min_version?(10) || node.eln?
map_type = 'lmdb'
else
map_type = 'hash'
end

# postfix remnant blocks running postalias if it exists
file '/etc/postfix/__db.aliases.db' do
action :delete
Expand All @@ -68,7 +76,7 @@
owner 'root'
group 'root'
mode '0644'
notifies :run, 'execute[postalias /etc/postfix/aliases]', :immediately
notifies :run, "execute[postalias #{map_type}:/etc/postfix/aliases]", :immediately
notifies :reload, 'service[postfix]'
end

Expand All @@ -89,18 +97,10 @@
end

# setup aliases file & db
execute 'postalias /etc/postfix/aliases' do
execute "postalias #{map_type}:/etc/postfix/aliases" do
action :nothing
end

# RHEL 10 and later don't support hash maps anymore
# https://src.fedoraproject.org/rpms/postfix/c/6a2621e4d73d59337dc64ba45922132286b841a1
if node.el_min_version?(10) || node.eln?
map_type = 'lmdb'
else
map_type = 'hash'
end

%w{
access
canonical
Expand Down

0 comments on commit 344da65

Please sign in to comment.