Skip to content

Commit

Permalink
add ipaddress sync
Browse files Browse the repository at this point in the history
  • Loading branch information
davidredborder committed Apr 21, 2024
1 parent 25ce5b2 commit 7854ac8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@
end
end
action :register do
ipaddress = new_resource.ipaddress

begin
consul_servers = system('serf members -tag consul=ready | grep consul=ready &> /dev/null')
if consul_servers and !node["minio"]["registered"]
query = {}
query["ID"] = "s3-#{node["hostname"]}"
query["Name"] = "s3"
query["Address"] = "#{node["ipaddress"]}"
query["Address"] = ipaddress
query["Port"] = node["minio"]["port"]
json_query = Chef::JSONCompat.to_json(query)

Expand Down
4 changes: 3 additions & 1 deletion resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

attribute :user, :kind_of => String, :default => "minio"
attribute :group, :kind_of => String, :default => "minio"
attribute :port, :kind_of => Fixnum, :default => 9000
attribute :port, :kind_of => Fixnum, :default => 9000

attribute :ipaddress, :kind_of => String, :default => "127.0.0.1"

0 comments on commit 7854ac8

Please sign in to comment.