Fix random port being used for EPMD node

Fixes not being able to join a cluster from other nodes, because the
ports are not within the firewall range of allowed ports.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
This commit is contained in:
2025-09-16 17:48:09 +02:00
parent ea4713c654
commit 73e8a2c413
2 changed files with 182 additions and 9 deletions

View File

@@ -65,15 +65,13 @@ file "/opt/ejabberd/.hosts.erlang" do
content ejabberd_hostnames.map{|h| "#{h}."}.join("\n")
end
ruby_block "configure ERLANG_NODE" do
block do
file = Chef::Util::FileEdit.new("/opt/ejabberd/conf/ejabberdctl.cfg")
file.search_file_replace_line(
%r{#ERLANG_NODE=ejabberd@localhost},
"ERLANG_NODE=ejabberd@#{node['name']}"
)
file.write_file
end
template "/opt/ejabberd/conf/ejabberdctl.cfg" do
source "ejabberdctl.cfg.erb"
mode 0644
owner 'ejabberd'
group 'ejabberd'
variables epmd_node_name: "ejabberd@#{node['name']}"
notifies :reload, "service[ejabberd]", :delayed
end
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')