Skip to content

Commit

Permalink
Merge pull request #28 from redBorder/development
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
manegron authored Oct 15, 2024
2 parents 278b065 + 65a91e9 commit 91d3a03
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 43 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
cookbook-minio CHANGELOG
===============

## 1.2.0

- manegron
- [359f3fb] Simplify add_mcli
- [bec1655] Improve mcli config
- [b63405a] Move mcli config to its own action
- [7cc8878] Bump version
- [780b272] Merge pull request #26 from redBorder/feature/add_mc_tool
- [a869458] Fix cookbook
- [e4a2bcb] Fix mcli_config.json
- [696ff5e] Fix lint
- [8f18e8b] Fix typo
- [7c5ddc6] Rename mc to mcli
- [85f8c79] fix mc config
- [22eeb08] fix mc config
- [26d47f3] fix mc config
- [cc0aea2] add mc
- Miguel Negron
- [7cc8878] Bump version
- [a869458] Fix cookbook
- [e4a2bcb] Fix mcli_config.json
- [696ff5e] Fix lint
- [8f18e8b] Fix typo
- [7c5ddc6] Rename mc to mcli
- [85f8c79] fix mc config
- [22eeb08] fix mc config
- [26d47f3] fix mc config
- [cc0aea2] add mc
- Miguel Negrón
- [780b272] Merge pull request #26 from redBorder/feature/add_mc_tool

## 1.1.0

- Miguel Negrón
Expand Down
2 changes: 1 addition & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
maintainer_email '[email protected]'
license 'AGPL-3.0'
description 'Installs/Configures Minio'
version '1.1.0'
version '1.2.0'
38 changes: 21 additions & 17 deletions resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
user = new_resource.user
s3_bucket = new_resource.s3_bucket
s3_endpoint = new_resource.s3_endpoint
managers_with_minio = new_resource.managers_with_minio

if !Minio::Helpers.s3_ready?
s3_user = Minio::Helpers.generate_random_key(20)
Expand Down Expand Up @@ -34,22 +33,6 @@
end
end

# MC tool configuration
directory '/root/.mcli' do
owner 'root'
group 'root'
mode '0755'
action :create
end

template '/root/.mcli/config.json' do
source 'mcli_config.json.erb'
cookbook 'minio'
variables(s3_user: s3_user,
s3_password: s3_password,
managers_with_minio: managers_with_minio)
end

service 'minio' do
service_name 'minio'
ignore_failure true
Expand Down Expand Up @@ -122,6 +105,27 @@
end
end

action :add_mcli do
managers_with_minio = new_resource.managers_with_minio
s3_user = new_resource.access_key_id
s3_password = new_resource.secret_key_id

directory '/root/.mcli' do
owner 'root'
group 'root'
mode '0755'
action :create
end

template '/root/.mcli/config.json' do
source 'mcli_config.json.erb'
cookbook 'minio'
variables(s3_user: s3_user,
s3_password: s3_password,
managers_with_minio: managers_with_minio)
end
end

action :remove do
begin

Expand Down
4 changes: 2 additions & 2 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
actions :add, :remove, :register, :deregister, :add_s3_conf_nginx
actions :add, :remove, :register, :deregister, :add_s3_conf_nginx, :add_mcli
default_action :add

attribute :user, kind_of: String, default: 'minio'
Expand All @@ -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 91d3a03

Please sign in to comment.