lib/kontena/machine/digital_ocean/master_provisioner.rb in kontena-plugin-digitalocean-0.2.2 vs lib/kontena/machine/digital_ocean/master_provisioner.rb in kontena-plugin-digitalocean-0.2.3
- old
+ new
@@ -56,24 +56,32 @@
end
end
master_url = "https://#{droplet.public_ip}"
Excon.defaults[:ssl_verify_peer] = false
- @http_client = Excon.new("#{master_url}", :connect_timeout => 10)
+ @http_client = Excon.new("#{master_url}", {
+ :connect_timeout => 10,
+ :ssl_verify_peer => false
+ })
spinner "Waiting for #{droplet.name.colorize(:cyan)} to start" do
sleep 0.5 until master_running?
end
puts
puts "Kontena Master is now running at #{master_url}".colorize(:green)
puts
- {
+ data = {
name: name.sub('kontena-master-', ''),
public_ip: droplet.public_ip,
code: opts[:initial_admin_code]
}
+ if respond_to?(:certificate_public_key) && !opts[:ssl_cert]
+ data[:ssl_certificate] = certificate_public_key(ssl_cert)
+ end
+
+ data
end
def user_data(vars)
cloudinit_template = File.join(__dir__ , '/cloudinit_master.yml')
erb(File.read(cloudinit_template), vars)