Skip to content

Commit

Permalink
Merge pull request #152 from redBorder/development
Browse files Browse the repository at this point in the history
release 2.0.0
  • Loading branch information
manegron authored Jun 13, 2024
2 parents 20cb1ee + 13bfb8a commit ccf75d8
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cookbook-rb-manager CHANGELOG
===============

## 2.0.0

- Miguel Álvarez
- [a28b728] Configure minio nodes and load balancer (#145)

## 1.9.3

- Miguel Negrón
Expand Down
1 change: 1 addition & 0 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# s3
default['redborder']['uploaded_s3'] = false
default['redborder']['s3']['s3_hosts'] = []

# chef-client
default['chef-client']['interval'] = 300
Expand Down
2 changes: 1 addition & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email '[email protected]'
license 'AGPL-3.0'
description 'Installs/Configures redborder manager'
version '1.9.3'
version '2.0.0'

depends 'rb-common'
depends 'chef-server'
Expand Down
33 changes: 20 additions & 13 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,28 +510,35 @@
end
end

s3_leader = `serf members | grep s3=ready | awk '{print $1'} | head -n 1`.strip
begin
s3_secrets = data_bag_item('passwords', 's3')
rescue
ssh_secrets = {}
end

# Allow only one s3 onpremise node for now.. TODO: Distributed MinIO
# Allow only s3 onpremise nodes for now..
minio_config 'Configure S3 (minio)' do
ipaddress node['ipaddress_sync']
if manager_services['s3'] && external_services['s3'] == 'onpremise' && s3_leader == node.name
action [:add, :register]
else
action [:remove, :deregister]
end
access_key_id s3_secrets['s3_access_key_id']
secret_key_id s3_secrets['s3_secret_key_id']
action((manager_services['s3'] && (external_services['s3'] == 'onpremise')) ? [:add, :register] : [:remove, :deregister])
end

nginx_config 'Configure S3 certs' do
service_name 's3'
cdomain node['redborder']['cdomain']
if manager_services['s3']
# First configure the cert for the service before configuring nginx
if manager_services['s3']
nginx_config 'Configure S3 certs' do
service_name 's3'
cdomain node['redborder']['cdomain']
action :configure_certs
else
action :nothing
end
end

# Configure Nginx s3 onpremise nodes for now..
minio_config 'Configure Nginx S3 (minio)' do
s3_hosts node['redborder']['s3']['s3_hosts']
action((manager_services['s3'] && (external_services['s3'] == 'onpremise')) ? [:add_s3_conf_nginx] : :nothing)
end

begin
ssh_secrets = data_bag_item('passwords', 'ssh')
rescue
Expand Down
4 changes: 4 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
# zk_hosts = node['redborder']['managers_per_services']['zookeeper'].map {|z| '#{z}.node:#{zk_port}'}.join(',')
node.default['redborder']['zookeeper']['zk_hosts'] = "zookeeper.service.#{node['redborder']['cdomain']}:#{node['redborder']['zookeeper']['port']}"

# Set all nodes with s3 configured (nginx load balancer)
s3_hosts = node['redborder']['managers_per_services']['s3'].map { |z| "#{z}.node:9000" }
node.default['redborder']['s3']['s3_hosts'] = s3_hosts

# set kafka host index if kafka is enabled in this host
if node['redborder']['managers_per_services']['kafka'].include?(node.name)
node.default['redborder']['kafka']['host_index'] = node['redborder']['managers_per_services']['kafka'].index(node.name)
Expand Down
4 changes: 4 additions & 0 deletions resources/templates/default/minio.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MINIO_OPTS="--address :9000 --console-address :9001 --config-dir /etc/minio"
MINIO_VOLUMES=/var/minio/data
MINIO_ROOT_USER=<%= @s3_user %>
MINIO_ROOT_PASSWORD=<%= @s3_password %>

0 comments on commit ccf75d8

Please sign in to comment.