Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

add support for ignore_server_availability_zone in openstack provider #317

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/bosh-bootstrap/microbosh_providers/openstack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def cloud_properties
"connection_options"=>{
"ssl_verify_peer"=>false
},
"boot_from_volume"=>boot_from_volume}
"boot_from_volume"=>boot_from_volume,
"ignore_server_availability_zone"=>ignore_server_availability_zone}
end

def region
Expand All @@ -129,6 +130,10 @@ def boot_from_volume
!!(settings.provider["options"] && settings.provider.options.boot_from_volume)
end

def ignore_server_availability_zone
!!(settings.provider["options"] && settings.provider.options.ignore_server_availability_zone)
end

# @return Bosh::Cli::PublicStemcell latest stemcell for openstack/trusty
def latest_stemcell
@latest_stemcell ||= begin
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: test-bosh
logging:
level: DEBUG
network:
type: manual
ip: 10.10.10.3
cloud_properties:
net_id: 7b8788eb-b49e-4424-9065-75a6b07094ea
resources:
persistent_disk: 32768
cloud_properties:
instance_type: m1.medium
cloud:
plugin: openstack
properties:
openstack:
auth_url: http://10.0.0.2:5000/v2.0/tokens
username: USER
api_key: PASSWORD
tenant: TENANT
region: REGION
default_security_groups:
- ssh
- dns-server
- bosh
default_key_name: test-bosh
state_timeout: 300
private_key: ~/.microbosh/ssh/test-bosh
connection_options:
ssl_verify_peer: false
boot_from_volume: false
ignore_server_availability_zone: true
agent:
ntp:
- 0.pool.ntp.org
- 1.pool.ntp.org
apply_spec:
agent:
blobstore:
address: 10.10.10.3
nats:
address: 10.10.10.3
properties:
director:
max_threads: 3
hm:
resurrector_enabled: true
ntp:
- 0.pool.ntp.org
- 1.pool.ntp.org
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ cloud:
connection_options:
ssl_verify_peer: false
boot_from_volume: false
ignore_server_availability_zone: false
agent:
ntp:
- 0.pool.ntp.org
Expand Down
8 changes: 8 additions & 0 deletions spec/unit/microbosh_providers/openstack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.boot_from_volume.yml"))
end

it "ignores server availability zone" do
setting "provider.options.ignore_server_availability_zone", true

subject.create_microbosh_yml(settings)
expect(File).to be_exists(microbosh_yml)
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.ignore_server_availability_zone.yml"))
end

it "adds recursor if present" do
setting "recursor", "4.5.6.7"

Expand Down