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