Files
ubicloud/rhizome/host/bin/setup-cert-server
Furkan Sahin 551930c262 Add Cert Server initializer
We are adding new states to the UpdateLoadBalancerNode prog to;
1. Publish cert and key files to the /vm/vmxxxxx/cert directory
2. Create a new web server to serve the files to the VM.
3. Remove the files and service in case the node is removed from the
loadbalancer.

We are utilizing go as the web server. The server source code lives in
ubicloud/cert-server. We are also starting it on the private address
[FD00:0B1C:100D:5AFE:CE::]:8080 because it is cool and looks like
"oo-bic-lood-safe-ce".
2024-09-12 11:26:45 +02:00

29 lines
600 B
Ruby
Executable File

#!/bin/env ruby
# frozen_string_literal: true
require_relative "../../common/lib/util"
require_relative "../lib/cert_server_setup"
require "fileutils"
unless (verb = ARGV.shift)
puts "expected verb as argument"
exit 1
end
unless (vm_name = ARGV.shift)
puts "expected vm_name as argument"
exit 1
end
cert_server_setup = CertServerSetup.new(vm_name)
case verb
when "setup"
cert_server_setup.copy_server
cert_server_setup.create_service
cert_server_setup.enable_and_start_service
when "stop_and_remove"
cert_server_setup.stop_and_remove_service
cert_server_setup.remove_paths
end