diff --git a/clients/garage-4.json b/clients/garage-4.json new file mode 100644 index 0000000..52b8248 --- /dev/null +++ b/clients/garage-4.json @@ -0,0 +1,4 @@ +{ + "name": "garage-4", + "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8it7QtT6zDiJJqlyHKfQ\nLqwu6bLblD15WWxlUSiOdhz3njWDv1BIDCAdkCR3HAXgxvk8sMj9QkvWS7u1+bc4\nxvHrY4Tgfg+Tk1h3gGa7ukll8s1WLIbGjj89vrK8PFr4iuDqRytYRMmcdMsNzPkS\nKcsOjFYWGV7KM/OwoQGVIOUPB+WtkrFAvNkXtIU6Wd5orzFMjt/9DPF2aO7QegL8\nG1mQmXcPGl9NSDUXptn/kzFKm/p4n7pjy6OypFT192ak7OA/s+CvQlaVE2tb/M3c\ne4J6A+PInV5AGKY6BxI3QRQLZIlqE0FXawFKr1iRU4JP4tVnICXZqy+SDXQU1zar\nTQIDAQAB\n-----END PUBLIC KEY-----\n" +} \ No newline at end of file diff --git a/environments/production.json b/environments/production.json new file mode 100644 index 0000000..f746d3e --- /dev/null +++ b/environments/production.json @@ -0,0 +1,10 @@ +{ + "name": "production", + "override_attributes": { + "garage": { + "replication_mode": "2", + "s3_api_root_domain": ".s3.garage.kosmos.org", + "s3_web_root_domain": ".web.garage.kosmos.org" + } + } +} diff --git a/nodes/garage-2.json b/nodes/garage-2.json index ce31ec1..5d80fc4 100644 --- a/nodes/garage-2.json +++ b/nodes/garage-2.json @@ -1,5 +1,6 @@ { "name": "garage-2", + "chef_environment": "production", "normal": { "knife_zero": { "host": "10.1.1.40" diff --git a/nodes/garage-3.json b/nodes/garage-3.json index d0ef159..3205be1 100644 --- a/nodes/garage-3.json +++ b/nodes/garage-3.json @@ -1,5 +1,6 @@ { "name": "garage-3", + "chef_environment": "production", "normal": { "knife_zero": { "host": "10.1.1.39" diff --git a/nodes/garage-4.json b/nodes/garage-4.json new file mode 100644 index 0000000..1d44336 --- /dev/null +++ b/nodes/garage-4.json @@ -0,0 +1,64 @@ +{ + "name": "garage-4", + "chef_environment": "production", + "normal": { + "knife_zero": { + "host": "10.1.1.104" + } + }, + "automatic": { + "fqdn": "garage-4", + "os": "linux", + "os_version": "5.4.0-132-generic", + "hostname": "garage-4", + "ipaddress": "192.168.122.123", + "roles": [ + "base", + "kvm_guest", + "garage_node" + ], + "recipes": [ + "kosmos-base", + "kosmos-base::default", + "kosmos_kvm::guest", + "kosmos_garage", + "kosmos_garage::default", + "kosmos_garage::firewall", + "apt::default", + "timezone_iii::default", + "timezone_iii::debian", + "ntp::default", + "ntp::apparmor", + "kosmos-base::systemd_emails", + "apt::unattended-upgrades", + "kosmos-base::firewall", + "kosmos-postfix::default", + "postfix::default", + "postfix::_common", + "postfix::_attributes", + "postfix::sasl_auth", + "hostname::default", + "firewall::default", + "chef-sugar::default" + ], + "platform": "ubuntu", + "platform_version": "20.04", + "cloud": null, + "chef_packages": { + "chef": { + "version": "17.10.3", + "chef_root": "/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib", + "chef_effortless": null + }, + "ohai": { + "version": "17.9.0", + "ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.9.0/lib/ohai" + } + } + }, + "run_list": [ + "role[base]", + "role[kvm_guest]", + "role[garage_node]" + ] +} \ No newline at end of file diff --git a/site-cookbooks/kosmos_garage/attributes/default.rb b/site-cookbooks/kosmos_garage/attributes/default.rb index c1c6b35..068ede8 100644 --- a/site-cookbooks/kosmos_garage/attributes/default.rb +++ b/site-cookbooks/kosmos_garage/attributes/default.rb @@ -1,9 +1,10 @@ -node.default['garage']['version'] = '0.8.0' -node.default['garage']['checksum']['amd64'] = '66dd2ea1f677281a43e10eb619523b1b269f8fde9047ce8caa70958f3b13ca74' -node.default['garage']['s3_api_port'] = 3900 -node.default['garage']['rpc_port'] = 3901 -node.default['garage']['s3_web_port'] = 3902 -node.default['garage']['admin_port'] = 3903 -node.default['garage']['k2v_api_port'] = 3904 -node.default['garage']['s3_api_root_domain'] = '.s3.garage.kosmos.org' -node.default['garage']['s3_web_root_domain'] = '.web.garage.kosmos.org' +node.default['garage']['version'] = '0.8.0' +node.default['garage']['checksum']['amd64'] = '66dd2ea1f677281a43e10eb619523b1b269f8fde9047ce8caa70958f3b13ca74' +node.default['garage']['s3_api_port'] = 3900 +node.default['garage']['rpc_port'] = 3901 +node.default['garage']['s3_web_port'] = 3902 +node.default['garage']['admin_port'] = 3903 +node.default['garage']['k2v_api_port'] = 3904 +node.default['garage']['s3_api_root_domain'] = '.s3.garage.localhost' +node.default['garage']['s3_web_root_domain'] = '.web.garage.localhost' +node.default['garage']['replication_mode'] = 'none' diff --git a/site-cookbooks/kosmos_garage/recipes/default.rb b/site-cookbooks/kosmos_garage/recipes/default.rb index 0019bbe..214bca8 100644 --- a/site-cookbooks/kosmos_garage/recipes/default.rb +++ b/site-cookbooks/kosmos_garage/recipes/default.rb @@ -30,7 +30,8 @@ template '/etc/garage.toml' do s3_web_root_domain: node['garage']['s3_web_root_domain'] || '.web.garage.localhost', k2v_api_port: node['garage']['k2v_api_port'], admin_port: node['garage']['admin_port'], - admin_token: credentials['admin_token'] + admin_token: credentials['admin_token'], + replication_mode: node['garage']['replication_mode'] notifies :restart, 'service[garage]', :delayed end diff --git a/site-cookbooks/kosmos_garage/templates/garage.toml.erb b/site-cookbooks/kosmos_garage/templates/garage.toml.erb index 85bfc6a..0bf6125 100644 --- a/site-cookbooks/kosmos_garage/templates/garage.toml.erb +++ b/site-cookbooks/kosmos_garage/templates/garage.toml.erb @@ -2,7 +2,7 @@ metadata_dir = "<%= @metadata_dir %>" data_dir = "<%= @data_dir %>" db_engine = "<%= @db_engine %>" -replication_mode = "none" +replication_mode = "<%= @replication_mode %>" rpc_bind_addr = "[::]:<%= @rpc_port %>" rpc_public_addr = "<%= @rpc_public_addr %>"