class Kontena::Plugin::Vagrant::Master::CreateCommand

Public Instance Methods

ask_instance_memory() click to toggle source
# File lib/kontena/plugin/vagrant/master/create_command.rb, line 31
def ask_instance_memory
  if self.memory.nil?
    prompt.select("Choose a size") do |menu|
      %w(512 1024 2048).each do |mem|
        menu.choice "#{mem}MB", mem
      end
    end
  else
    self.memory
  end
end
execute() click to toggle source
# File lib/kontena/plugin/vagrant/master/create_command.rb, line 17
def execute
  require_relative '../../../machine/vagrant'
  mem = ask_instance_memory
  provisioner.run!(
    name: name,
    memory: mem,
    version: version,
    vault_secret: vault_secret || SecureRandom.hex(24),
    vault_iv: vault_iv || SecureRandom.hex(24),
    initial_admin_code: SecureRandom.hex(16),
    coreos_channel: coreos_channel
  )
end
provisioner() click to toggle source
# File lib/kontena/plugin/vagrant/master/create_command.rb, line 43
def provisioner
  Kontena::Machine::Vagrant::MasterProvisioner.new
end