Skip to content

Commit

Permalink
Improve mcli config
Browse files Browse the repository at this point in the history
  • Loading branch information
manegron committed Oct 15, 2024
1 parent b63405a commit bec1655
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
attribute :s3_endpoint, kind_of: String, default: 's3.service'
attribute :ipaddress, kind_of: String, default: '127.0.0.1'
attribute :s3_hosts, kind_of: Array, default: ['localhost:9000']
attribute :managers_with_minio, kind_of: Array, default: ['localhost']
attribute :managers_with_minio, kind_of: Array, default: []
27 changes: 4 additions & 23 deletions resources/templates/default/mcli_config.json.erb
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
{
"version": "10",
"aliases": {
"gcs": {
"url": "https://storage.googleapis.com",
"accessKey": "YOUR-ACCESS-KEY-HERE",
"secretKey": "YOUR-SECRET-KEY-HERE",
"api": "S3v2",
"path": "dns"
},
<% if @managers_with_minio.include?(node.name) %>
"local": {
"url": "http://localhost:9000",
"accessKey": "<%= @s3_user %>",
"secretKey": "<%= @s3_password %>",
"api": "S3v4",
"path": "auto"
},
"play": {
"url": "https://play.min.io",
"accessKey": "YOUR-ACCESS-KEY-HERE",
"secretKey": "YOUR-ACCESS-KEY-HERE",
"api": "S3v4",
"path": "auto"
},
<% @managers_with_minio.each do |m| %>
<% end %>
<% @managers_with_minio.each_with_index do |m, index| %>
<% manager = (m == 'localhost') ? node.name : m %>
"<%= manager %>": {
"url": "<%= "http://#{manager}.#{node.default['redborder']['cdomain']}:#{node['minio']['port']}" %>",
"accessKey": "<%= @s3_user %>",
"secretKey": "<%= @s3_password %>",
"api": "s3v4",
"path": "auto"
},
}<% if index < @managers_with_minio.length - 1 %>,<% end %>
<% end %>
"s3": {
"url": "https://s3.amazonaws.com",
"accessKey": "YOUR-ACCESS-KEY-HERE",
"secretKey": "YOUR-SECRET-KEY-HERE",
"api": "S3v4",
"path": "dns"
}
}
}

0 comments on commit bec1655

Please sign in to comment.