Class: UnitHosting::VmRecipe

Inherits:
Object
  • Object
show all
Defined in:
lib/unit_hosting/vm_recipe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVmRecipe

Returns a new instance of VmRecipe.



8
9
10
# File 'lib/unit_hosting/vm_recipe.rb', line 8

def initialize
  @op_user = ENV['USER']
end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



7
8
9
# File 'lib/unit_hosting/vm_recipe.rb', line 7

def display_name
  @display_name
end

#op_mailObject

Returns the value of attribute op_mail.



7
8
9
# File 'lib/unit_hosting/vm_recipe.rb', line 7

def op_mail
  @op_mail
end

#op_userObject

Returns the value of attribute op_user.



7
8
9
# File 'lib/unit_hosting/vm_recipe.rb', line 7

def op_user
  @op_user
end

#plan_idObject

Returns the value of attribute plan_id.



6
7
8
# File 'lib/unit_hosting/vm_recipe.rb', line 6

def plan_id
  @plan_id
end

#rootpwObject

Returns the value of attribute rootpw.



6
7
8
# File 'lib/unit_hosting/vm_recipe.rb', line 6

def rootpw
  @rootpw
end

#ssh_keyObject

Returns the value of attribute ssh_key.



6
7
8
# File 'lib/unit_hosting/vm_recipe.rb', line 6

def ssh_key
  @ssh_key
end

#user_scriptObject

Returns the value of attribute user_script.



7
8
9
# File 'lib/unit_hosting/vm_recipe.rb', line 7

def user_script
  @user_script
end

Instance Method Details

#load_ssh_key(file) ⇒ Object



11
12
13
14
15
# File 'lib/unit_hosting/vm_recipe.rb', line 11

def load_ssh_key file
  File::open(file) do |f|
    @ssh_key =  f.read
  end
end

#paramsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/unit_hosting/vm_recipe.rb', line 16

def params
  param = {
    "rootpw" => @rootpw,
    "ssh_key" => @ssh_key,
    "op_user" => @op_user,
    "op_mail" => @op_mail,
    "user_script" => @user_script,
    "plan_id" => @plan_id,
    "display_name" => @display_name
  }
end