Class: Kontena::Plugin::Upcloud::Master::CreateCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common
Defined in:
lib/kontena/plugin/upcloud/master/create_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/kontena/plugin/upcloud/master/create_command.rb', line 19

def execute

  require_relative '../../../machine/upcloud'

  provisioner = Kontena::Machine::Upcloud::MasterProvisioner.new(username, password)
  provisioner.run!(
      name: self.name,
      ssh_key: ssh_key,
      ssl_cert: ssl_cert,
      plan: plan,
      zone: zone,
      version: version,
      vault_secret: vault_secret || SecureRandom.hex(24),
      vault_iv: vault_iv || SecureRandom.hex(24),
      initial_admin_code: SecureRandom.hex(16),
      mongodb_uri: mongodb_uri
  )
end