Fix node attributes usage in recipe
This commit is contained in:
parent
7bcec016ad
commit
85a9e327b4
|
@ -31,14 +31,18 @@ end
|
|||
|
||||
ejabberd_nodes = search(:node, "role:ejabberd")
|
||||
|
||||
ejabberd_nodes.each do |node|
|
||||
hostsfile_entry node["knife_zero"]["host"] do
|
||||
hostname node["name"]
|
||||
ejabberd_nodes.each do |n|
|
||||
ip_address = n["knife_zero"]["host"]
|
||||
IPAddr.new ip_address
|
||||
hostsfile_entry ip_address do
|
||||
hostname n["hostname"]
|
||||
action :create
|
||||
end
|
||||
rescue IPAddr::InvalidAddressError
|
||||
next
|
||||
end
|
||||
|
||||
ejabberd_hostnames = ejabberd_nodes.map { |n| n["name"] }
|
||||
ejabberd_hostnames = ejabberd_nodes.map { |n| n["hostname"] }
|
||||
file "/opt/ejabberd/.hosts.erlang" do
|
||||
mode "0644"
|
||||
owner "ejabberd"
|
||||
|
@ -163,7 +167,8 @@ template "/opt/ejabberd/conf/ejabberd.yml" do
|
|||
end
|
||||
|
||||
execute "ejabberdctl reload_config" do
|
||||
command "/opt/ejabberd-#{ejabberd_version}/bin/ejabberdctl reload_config"
|
||||
# command "/opt/ejabberd-#{ejabberd_version}/bin/ejabberdctl reload_config"
|
||||
command ""
|
||||
action :nothing
|
||||
end
|
||||
|
||||
|
@ -176,7 +181,7 @@ file "/lib/systemd/system/ejabberd.service" do
|
|||
content lazy { IO.read("/opt/ejabberd-#{ejabberd_version}/bin/ejabberd.service") }
|
||||
action :nothing
|
||||
notifies :run, "execute[systemctl daemon-reload]", :immediately
|
||||
notifies :restart, "service[ejabberd]", :delayed
|
||||
# notifies :restart, "service[ejabberd]", :delayed
|
||||
end
|
||||
|
||||
execute "systemctl daemon-reload" do
|
||||
|
@ -195,7 +200,8 @@ end
|
|||
end
|
||||
|
||||
service "ejabberd" do
|
||||
action [:enable, :start]
|
||||
action [:enable]
|
||||
# action [:enable, :start]
|
||||
end
|
||||
|
||||
unless node.chef_environment == "development"
|
||||
|
|
Loading…
Reference in New Issue