diff --git a/resources/providers/config.rb b/resources/providers/config.rb index 3558ba0..9e7a4b6 100644 --- a/resources/providers/config.rb +++ b/resources/providers/config.rb @@ -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) diff --git a/resources/resources/config.rb b/resources/resources/config.rb index 8d33662..30b5972 100644 --- a/resources/resources/config.rb +++ b/resources/resources/config.rb @@ -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 \ No newline at end of file +attribute :port, :kind_of => Fixnum, :default => 9000 + +attribute :ipaddress, :kind_of => String, :default => "127.0.0.1" \ No newline at end of file