Class: Bosh::Bootstrap::MicroboshProviders::OpenStack

Inherits:
Base
  • Object
show all
Defined in:
lib/bosh-bootstrap/microbosh_providers/openstack.rb

Instance Attribute Summary

Attributes inherited from Base

#manifest_path, #settings

Instance Method Summary collapse

Methods inherited from Base

#create_microbosh_yml, #initialize, #microbosh_name, #private_key_path, #public_ip, #salted_password

Constructor Details

This class inherits a constructor from Bosh::Bootstrap::MicroboshProviders::Base

Instance Method Details

#cloud_propertiesObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 39

def cloud_properties
  {
    "auth_url"=>settings.provider.credentials.openstack_auth_url,
    "username"=>settings.provider.credentials.openstack_username,
    "api_key"=> settings.provider.credentials.openstack_api_key,
    "tenant"=>  settings.provider.credentials.openstack_tenant,
    "default_security_groups"=>security_groups,
    "default_key_name"=>microbosh_name,
    "private_key"=>private_key_path}
end

#network_configurationObject

network:

name: default
type: dynamic
label: private
ip: 1.2.3.4


31
32
33
34
35
36
37
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 31

def network_configuration
  {"name"=>"default",
    "type"=>"dynamic",
    "label"=>"private",
    "ip"=>public_ip
  }
end

#persistent_diskObject



18
19
20
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 18

def persistent_disk
  settings.bosh.persistent_disk
end

#resources_cloud_propertiesObject



22
23
24
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 22

def resources_cloud_properties
  {"instance_type"=>"m1.medium"}
end

#security_groupsObject



50
51
52
53
54
55
56
57
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 50

def security_groups
  ["ssh",
   "bosh_agent_http",
   "bosh_nats_server",
   "bosh_blobstore",
   "bosh_director",
   "bosh_registry"]
end

#to_hashObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bosh-bootstrap/microbosh_providers/openstack.rb', line 5

def to_hash
  super.merge({
   "network"=>network_configuration,
   "resources"=>
    {"persistent_disk"=>persistent_disk,
     "cloud_properties"=>resources_cloud_properties},
   "cloud"=>
    {"plugin"=>"openstack",
     "properties"=>
      {"openstack"=>cloud_properties}},
  })
end