Module: Bosh::Deployer::BoshSettings

Included in:
BoshStub, CFStub
Defined in:
lib/bosh-deployer/bosh_settings.rb

Instance Method Summary collapse

Instance Method Details

#default_key_nameObject



8
9
10
11
12
# File 'lib/bosh-deployer/bosh_settings.rb', line 8

def default_key_name
  @default_key_name ||= ask('Key name:') do |q|
    q.default = 'firstbosh'
  end
end

#gatewayObject



64
65
66
67
68
69
# File 'lib/bosh-deployer/bosh_settings.rb', line 64

def gateway
  @gateway ||= ask('Gateway IP:') do |q|
    #UGLY REPLACE ME WITH A REGEX
    q.default = (static_ip_from.split('.')[0..-2] + ['1']).join('.')
  end
end

#microboshObject



4
5
6
# File 'lib/bosh-deployer/bosh_settings.rb', line 4

def microbosh
  @microbosh ||= Bosh::Deployer::MicroboshSettings.load
end

#openstack_api_keyObject



40
41
42
43
44
# File 'lib/bosh-deployer/bosh_settings.rb', line 40

def openstack_api_key
  @openstack_api_key ||= ask('Openstack api key:') do |q|
    q.default =  microbosh.provider.credentials.openstack_api_key if microbosh
  end
end

#openstack_auth_urlObject



28
29
30
31
32
# File 'lib/bosh-deployer/bosh_settings.rb', line 28

def openstack_auth_url
  @openstack_auth_url ||= ask('Openstack auth url:') do |q|
    q.default = microbosh.provider.credentials.openstack_auth_url.gsub('/tokens', '') if microbosh
  end
end

#openstack_tenantObject



46
47
48
49
50
# File 'lib/bosh-deployer/bosh_settings.rb', line 46

def openstack_tenant
  @openstack_tenant ||= ask('Openstack tenant:') do |q|
    q.default =  microbosh.provider.credentials.openstack_tenant if microbosh
  end
end

#openstack_usernameObject



34
35
36
37
38
# File 'lib/bosh-deployer/bosh_settings.rb', line 34

def openstack_username
  @openstack_username ||= ask('Openstack username:') do |q|
    q.default =  microbosh.provider.credentials.openstack_username if microbosh
  end
end

#private_keyObject



14
15
16
17
18
# File 'lib/bosh-deployer/bosh_settings.rb', line 14

def private_key
  @private_key ||= ask('Private key:') do |q|
    q.default = '~/.microbosh/ssh/firstbosh.pem'
  end
end

#rangeObject



71
72
73
74
75
76
# File 'lib/bosh-deployer/bosh_settings.rb', line 71

def range
  @range ||= ask('Ip Range where it will be deployed:') do |q|
    #UGLY REPLACE ME WITH A REGEX
    q.default = (static_ip_from.split('.')[0..-2] + ['0']).join('.') + '/24'
  end
end

#recursor_ipObject



52
53
54
55
56
# File 'lib/bosh-deployer/bosh_settings.rb', line 52

def recursor_ip
  @recursor_ip ||= ask('Recursor ip or host:') do |q|
    q.default = microbosh.address.ip if microbosh
  end
end

#static_ip_fromObject



20
21
22
# File 'lib/bosh-deployer/bosh_settings.rb', line 20

def static_ip_from
  @static_ip_from ||= ask 'Intial available static ip for deployment:'
end

#static_ip_toObject



24
25
26
# File 'lib/bosh-deployer/bosh_settings.rb', line 24

def static_ip_to
  @static_ip_to ||= ask 'Last available static ip for deployment:'
end

#subnet_idObject



58
59
60
61
62
# File 'lib/bosh-deployer/bosh_settings.rb', line 58

def subnet_id
  @subnet_id ||= ask('Subnet ID where it will be deployed:') do |q|
    q.default = microbosh.address.subnet_id if microbosh
  end
end