Class: VagrantAWS::Config

Inherits:
Vagrant::Config::Base
  • Object
show all
Defined in:
lib/vagrant-aws/config.rb

Overview

the ‘vagrant-aws` plugin.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



18
19
20
21
22
23
24
# File 'lib/vagrant-aws/config.rb', line 18

def initialize
	@security_groups   = ["default"]
	@region            = "us-east-1"
	@username          = "ubuntu"
	@image             = "ami-2ec83147"
	@flavor            = "t1.micro"
end

Instance Attribute Details

#availability_zoneObject

Returns the value of attribute availability_zone.



16
17
18
# File 'lib/vagrant-aws/config.rb', line 16

def availability_zone
  @availability_zone
end

#flavorObject

Returns the value of attribute flavor.



13
14
15
# File 'lib/vagrant-aws/config.rb', line 13

def flavor
  @flavor
end

#imageObject

Returns the value of attribute image.



12
13
14
# File 'lib/vagrant-aws/config.rb', line 12

def image
  @image
end

#key_nameObject

Returns the value of attribute key_name.



7
8
9
# File 'lib/vagrant-aws/config.rb', line 7

def key_name
  @key_name
end

#private_key_pathObject



30
31
32
# File 'lib/vagrant-aws/config.rb', line 30

def private_key_path
	@private_key_path.nil? ? nil : File.expand_path(@private_key_path)
end

#regionObject

Returns the value of attribute region.



15
16
17
# File 'lib/vagrant-aws/config.rb', line 15

def region
  @region
end

#security_groupsObject

Returns the value of attribute security_groups.



10
11
12
# File 'lib/vagrant-aws/config.rb', line 10

def security_groups
  @security_groups
end

#usernameObject

Returns the value of attribute username.



9
10
11
# File 'lib/vagrant-aws/config.rb', line 9

def username
  @username
end

Instance Method Details

#using?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/vagrant-aws/config.rb', line 26

def using?
	return top.env.is_a?(VagrantAWS::Environment)
end

#validate(errors) ⇒ Object



34
35
36
# File 'lib/vagrant-aws/config.rb', line 34

def validate(errors)
	errors.add(I18n.t("vagrant.config.ssh.private_key_missing", :path => private_key_path)) if private_key_path && !File.exists?(private_key_path)
end