Module: Bosh::Deployer::BoshSettings
Instance Method Summary collapse
- #default_key_name ⇒ Object
- #gateway ⇒ Object
- #microbosh ⇒ Object
- #openstack_api_key ⇒ Object
- #openstack_auth_url ⇒ Object
- #openstack_tenant ⇒ Object
- #openstack_username ⇒ Object
- #private_key ⇒ Object
- #range ⇒ Object
- #recursor_ip ⇒ Object
- #static_ip_from ⇒ Object
- #static_ip_to ⇒ Object
- #subnet_id ⇒ Object
Instance Method Details
#default_key_name ⇒ Object
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 |
#gateway ⇒ Object
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 |
#microbosh ⇒ Object
4 5 6 |
# File 'lib/bosh-deployer/bosh_settings.rb', line 4 def microbosh @microbosh ||= Bosh::Deployer::MicroboshSettings.load end |
#openstack_api_key ⇒ Object
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_url ⇒ Object
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_tenant ⇒ Object
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_username ⇒ Object
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_key ⇒ Object
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 |
#range ⇒ Object
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_ip ⇒ Object
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_from ⇒ Object
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_to ⇒ Object
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_id ⇒ Object
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 |