Skip to content

Commit

Permalink
Bugfix/fix sync ip (#91)
Browse files Browse the repository at this point in the history
* pass sync ip to chef-server and kafka
  • Loading branch information
manegron authored Dec 1, 2023
1 parent 4c04e6b commit c8288e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
consul_config "Configure Consul Server" do
confdir node["consul"]["confdir"]
datadir node["consul"]["datadir"]
ipaddress node["ipaddress"]
ipaddress node["ipaddress_sync"]
cdomain node["redborder"]["cdomain"]
dns_local_ip node["consul"]["dns_local_ip"]
(manager_services["consul"] ? (is_server true) : (is_server false))
Expand All @@ -38,6 +38,7 @@
postgresql false
postgresql_memory node["redborder"]["memory_services"]["postgresql"]["memory"]
chef_active manager_services["chef-server"]
ipaddress node["ipaddress_sync"]
action [:add, :register]
end
else
Expand All @@ -59,6 +60,7 @@
managers_list node["redborder"]["managers_per_services"]["kafka"]
zk_hosts node["redborder"]["zookeeper"]["zk_hosts"]
host_index node["redborder"]["kafka"]["host_index"]
ipaddress node["ipaddress_sync"]
action (manager_services["kafka"] ? [:add, :register] : [:remove, :deregister])
end

Expand Down
8 changes: 8 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
node.default["redborder"]["services"]["consul-client"] = true
end

#Set :ipaddress_sync
ipaddress_sync=node["ipaddress"]
node['network']['interfaces'].each do |interface, details|
next unless "x#{interface}" != "xlo"
ipaddress_sync = details['addresses'].keys[1] if (details['addresses'] and ipaddress_sync != details['addresses'].keys[1])
end
node.default[:ipaddress_sync]=ipaddress_sync

#Configure and enable chef-client
dnf_package "redborder-chef-client" do
flush_cache [:before]
Expand Down

0 comments on commit c8288e2

Please sign in to comment.