Class: Bosh::AwsCliPlugin::BoshManifest

Inherits:
MicroboshManifest show all
Defined in:
lib/bosh_cli_plugin_aws/bosh_manifest.rb

Instance Attribute Summary collapse

Attributes inherited from MicroboshManifest

#hm_director_password, #hm_director_user, #keep_unreachable_vms, #route53_receipt, #vpc_receipt

Instance Method Summary collapse

Methods inherited from MicroboshManifest

#access_key_id, #availability_zone, #cache_access_key_id, #cache_bucket_name, #cache_secret_access_key, #certificate, #compiled_package_cache?, #director_ssl, #get_template, #key_pair_name, #name, #network_type, #private_key_path, #region, #secret_access_key, #ssl_certs, #subnet, #vpc_config

Constructor Details

#initialize(vpc_receipt, route53_receipt, director_uuid, rds_receipt, options = {}) ⇒ BoshManifest

Returns a new instance of BoshManifest.



9
10
11
12
13
14
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 9

def initialize(vpc_receipt, route53_receipt, director_uuid, rds_receipt, options={})
  super(vpc_receipt, route53_receipt, options)
  @director_uuid = director_uuid
  @rds_receipt = rds_receipt
  @stemcell_name = 'bosh-aws-xen-ubuntu'
end

Instance Attribute Details

#director_uuidObject (readonly)

Returns the value of attribute director_uuid.



5
6
7
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 5

def director_uuid
  @director_uuid
end

#rds_receiptObject (readonly)

Returns the value of attribute rds_receipt.



5
6
7
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 5

def rds_receipt
  @rds_receipt
end

#stemcell_nameObject

Returns the value of attribute stemcell_name.



7
8
9
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 7

def stemcell_name
  @stemcell_name
end

Instance Method Details

#bosh_deployment_nameObject



28
29
30
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 28

def bosh_deployment_name
  "vpc-bosh-#{name}"
end

#bosh_rds_hostObject



44
45
46
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 44

def bosh_rds_host
  bosh_rds_properties['address']
end

#bosh_rds_passwordObject



52
53
54
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 52

def bosh_rds_password
  bosh_rds_properties['roles'].first['password']
end

#bosh_rds_portObject



48
49
50
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 48

def bosh_rds_port
  bosh_rds_properties['port']
end

#bosh_rds_propertiesObject



40
41
42
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 40

def bosh_rds_properties
  rds_receipt['deployment_manifest']['properties']['bosh']
end

#bosh_rds_userObject



56
57
58
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 56

def bosh_rds_user
  bosh_rds_properties['roles'].first['name']
end

#deployment_nameObject



20
21
22
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 20

def deployment_name
  "bosh"
end

#director_ssl_certObject



36
37
38
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 36

def director_ssl_cert
  certificate.certificate.gsub("\n", "\n        ")
end

#director_ssl_keyObject



32
33
34
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 32

def director_ssl_key
  certificate.key.gsub("\n", "\n        ")
end

#file_nameObject



16
17
18
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 16

def file_name
  "bosh.yml"
end

#to_yObject

RSpec overloads to_yaml when you set up expectations on an object; so to_y is just a way to get directly at the to_yaml implementation without fighting RSpec.



62
63
64
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 62

def to_y
  ERB.new(File.read(get_template("bosh.yml.erb"))).result(binding)
end

#to_yamlObject



66
67
68
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 66

def to_yaml
  to_y
end

#vipObject



24
25
26
# File 'lib/bosh_cli_plugin_aws/bosh_manifest.rb', line 24

def vip
  route53_receipt['elastic_ips']['bosh']['ips'][0] || warning('Missing vip field')
end