bosh-bootstrap 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +1 -1
  3. data/ChangeLog.md +106 -87
  4. data/Gemfile +1 -0
  5. data/bosh-bootstrap.gemspec +2 -2
  6. data/lib/bosh-bootstrap/cli/commands/deploy.rb +3 -3
  7. data/lib/bosh-bootstrap/microbosh_providers/aws.rb +1 -5
  8. data/lib/bosh-bootstrap/microbosh_providers/base.rb +4 -0
  9. data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +57 -12
  10. data/lib/bosh-bootstrap/network.rb +4 -5
  11. data/lib/bosh-bootstrap/network_providers/aws.rb +5 -9
  12. data/lib/bosh-bootstrap/network_providers/dummy.rb +1 -1
  13. data/lib/bosh-bootstrap/network_providers/openstack.rb +6 -18
  14. data/lib/bosh-bootstrap/version.rb +1 -1
  15. data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.us-west-2a.yml +1 -5
  16. data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml +1 -5
  17. data/spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml +1 -5
  18. data/spec/assets/microbosh_yml/micro_bosh.openstack.boot_from_volume.yml +43 -0
  19. data/spec/assets/microbosh_yml/micro_bosh.openstack.neutron_manual.yml +43 -0
  20. data/spec/assets/microbosh_yml/{micro_bosh.openstack.yml → micro_bosh.openstack.neutron_vip.yml} +12 -13
  21. data/spec/assets/microbosh_yml/micro_bosh.openstack.nova_vip.yml +41 -0
  22. data/spec/spec_helper.rb +3 -3
  23. data/spec/support/rspec-fire.rb +9 -0
  24. data/spec/unit/commands/deploy_spec.rb +73 -60
  25. data/spec/unit/key_pair_spec.rb +3 -3
  26. data/spec/unit/microbosh_providers/openstack_spec.rb +87 -18
  27. data/spec/unit/microbosh_spec.rb +2 -2
  28. data/spec/unit/network_providers/aws_spec.rb +5 -9
  29. data/spec/unit/network_providers/openstack_spec.rb +5 -9
  30. data/spec/unit/network_spec.rb +5 -6
  31. metadata +28 -20
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDZkNmI0MDEyODI1NGNiMjRjYmJjZmExOGY4ZmFmZDNkNWY3YzIwOA==
5
- data.tar.gz: !binary |-
6
- MGQzNWNkMWZkZTE2ODZmMzU2Y2EwY2EwNTQxMDM5YTk0YzJjZDcwOQ==
2
+ SHA1:
3
+ metadata.gz: 3234c415f1c36b95d1afdbff6bddc71547be43c2
4
+ data.tar.gz: 4e45a51e0833104c7f173477579c6b859f6477e3
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmVkNTdiMTM1ZmFkMWMzYjUyMGIwNDU1NWZjZGZkYmUyYWRjMGJkZmZmNDg4
10
- ZThhZjI5NjMyODBjOTZlNDUzMWQ1MGZhMzJlNGVjMmE3MjA3NDVmNGQ2NjBm
11
- MzY3YzExMGMwODIwOWE3N2Q2YjFkMjI4YWVlOTY2OWNhNzMwODI=
12
- data.tar.gz: !binary |-
13
- YzU3ZDQ0ODE4NmJiYjQzYTU1NDlmYWIwZmRkMGY4Njk1NDljZTY3YjZiYzE2
14
- ZWQ3NTQyZDg1ZjQyYzBiMTRkYWQ4MDQ5YWNjMjdhNjVhZjA3YWI1YjE1ZWZj
15
- YTgwNDU0MDNkYmU0MDM0YzcyN2ExZjNiODhjZjAzZGFiYjgwMjU=
6
+ metadata.gz: 6dbcaeeca32850eedf92bcf937142b347a461c5719bb9461ecdc8fd554b8b56c7695e16448df206c86cddbbc8dc195fe4d0bb3faa6bfbac4db13fdd14ab8365f
7
+ data.tar.gz: 29598c72646bddb8b601debcb9f7af6180600929ec2e3d6a6743d899ea0741b7ef625c2d5f136e737ae9fb7b309561ef0ec0e923789203eece7cff113625181c
data/.travis.yml CHANGED
@@ -2,8 +2,8 @@ language: ruby
2
2
  script: bundle exec rake spec:$SUITE
3
3
  rvm:
4
4
  - ruby-1.9.3
5
- - rbx-19mode
6
5
  - ruby-2.0.0
6
+ - ruby-2.1.0
7
7
  notifications:
8
8
  email:
9
9
  recipients:
data/ChangeLog.md CHANGED
@@ -1,129 +1,148 @@
1
- # Change Log
1
+ Change Log
2
+ ==========
2
3
 
3
4
  `bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on AWS (with OpenStack & vSphere coming soon).
4
5
 
5
- gem install bosh-bootstrap
6
- bosh-bootstrap deploy
7
-
8
- ## Next
9
-
10
- ## v0.12
11
-
12
- * vSphere support [thanks Matt Stine!!]
13
-
14
- ## v0.11
15
-
16
- * Complete rewrite of bosh-bootstrap in orphan branch
17
- * CodeClimate score changed from 0.82 to 3.85
18
- * Initial support for AWS EC2; WIP for OpenStack; initial unit tests for vSphere
19
- * Interactive Q&A is extracted into [cyoi](https://github.com/drnic/cyoi) (choose-your-own-infrastructure) library
20
- * Accessing settings is much cleaner; functionality moved into fork of settingslogic called [readwritesettings](https://github.com/drnic/readwritesettings)
21
- * Inception VM/server is now provisioned via separate CLI project [inception-server](https://github.com/drnic/inception-server)
22
- * AWS/us-east-1 uses public AMIs; other regions & other CPIs use stemcells
23
- * CLI via bosh plugin (`bosh bootstrap`) rather than a stand alone CLI (`bosh-bootstrap`)
24
- * Added `ssh` action to ssh into the microbosh
25
- * Added `delete` actions to delete the microbosh (but not the IP address and security groups)
26
- * Add back `bosh-bootstrap` CLI & remove bosh_cli dependency (v0.11.1)
27
- * Specify which AWS AZ to use via `provider.az` in settings.yml (v0.11.2)
28
- * Support for OpenStack (also in cyoi 0.4.3) thanks to Ferdy! (v0.11.3)
29
- * Ensure CLI loads bundler (v0.11.4)
30
- * rubygem users should be able to install & run from rubygems instead of source workaround (v0.11.5)
31
- * microbosh volume is smaller 4G and automatically fits on devstack/openstack (v0.11.5; thx @ryfow)
32
- * Security group `bosh_agent_http` renamed to `bosh_agent_https`, with same 6868 port for talking to bosh_agent running in https mode (`bosh_agent_http` can then be deleted) (v0.11.5)
33
- * Add port 53/dns security group (v0.11.6)
34
- * Port 53 open on UDP only as workaround for multi-region AWS (v0.11.7; thx @yudai)
35
- * Suppress bundler git "fatal" warnings (by converting ~/.microbosh into git repo) (v0.11.8)
36
- * Update to newer-er-er stemcell paths from Pivotal's s3 bucket (v0.11.9, v0.11.10)
37
- * Enlarge persistent disk from 4G to 16G (v0.11.11)
38
- * bosh_cli gems now on rubygems instead of pivotal s3 bucket (v0.11.12)
39
- * OpenStack improvements to reduce POST API throttling (v0.11.13)
40
- * Can now update a running microbosh (thanks @lookitup4me) (v0.11.14)
41
- * OpenStack uses commonly available m1.medium flavor instead of bespoke m1.microbosh (v0.11.14)
42
- * Properly enlarge persistent disk from 4G to 16G (v0.11.15)
43
-
44
- ## v0.10
6
+ ```
7
+ gem install bosh-bootstrap
8
+ bosh-bootstrap deploy
9
+ ```
10
+
11
+ v0.13
12
+ -----
13
+
14
+ - [openstack] Neutron support - detects that Neutron is available and prompts for which subnet to use
15
+ - [openstack] Boot from volume - prompt for which images should be used (QCOW2 vs RAW) and configure MicroBOSH to use boot_from_volume if RAW format required
16
+ - only create 3 security groups instead of many (fix for new AWS accounts and OpenStack tenants with small quotas)
17
+ - testing for ruby 2.1.0; though BOSH still requires 1.9.3 at time of writing
18
+ - upgrade rspec for 3.0 and using expect/to syntax
19
+
20
+ v0.12
21
+ -----
22
+
23
+ - vSphere support [thanks Matt Stine!!]
24
+
25
+ v0.11
26
+ -----
27
+
28
+ - Complete rewrite of bosh-bootstrap in orphan branch
29
+ - CodeClimate score changed from 0.82 to 3.85
30
+ - Initial support for AWS EC2; WIP for OpenStack; initial unit tests for vSphere
31
+ - Interactive Q&A is extracted into [cyoi](https://github.com/drnic/cyoi) (choose-your-own-infrastructure) library
32
+ - Accessing settings is much cleaner; functionality moved into fork of settingslogic called [readwritesettings](https://github.com/drnic/readwritesettings)
33
+ - Inception VM/server is now provisioned via separate CLI project [inception-server](https://github.com/drnic/inception-server)
34
+ - AWS/us-east-1 uses public AMIs; other regions & other CPIs use stemcells
35
+ - CLI via bosh plugin (`bosh bootstrap`) rather than a stand alone CLI (`bosh-bootstrap`)
36
+ - Added `ssh` action to ssh into the microbosh
37
+ - Added `delete` actions to delete the microbosh (but not the IP address and security groups)
38
+ - Add back `bosh-bootstrap` CLI & remove bosh_cli dependency (v0.11.1)
39
+ - Specify which AWS AZ to use via `provider.az` in settings.yml (v0.11.2)
40
+ - Support for OpenStack (also in cyoi 0.4.3) thanks to Ferdy! (v0.11.3)
41
+ - Ensure CLI loads bundler (v0.11.4)
42
+ - rubygem users should be able to install & run from rubygems instead of source workaround (v0.11.5)
43
+ - microbosh volume is smaller 4G and automatically fits on devstack/openstack (v0.11.5; thx @ryfow)
44
+ - Security group `bosh_agent_http` renamed to `bosh_agent_https`, with same 6868 port for talking to bosh_agent running in https mode (`bosh_agent_http` can then be deleted) (v0.11.5)
45
+ - Add port 53/dns security group (v0.11.6)
46
+ - Port 53 open on UDP only as workaround for multi-region AWS (v0.11.7; thx @yudai)
47
+ - Suppress bundler git "fatal" warnings (by converting ~/.microbosh into git repo) (v0.11.8)
48
+ - Update to newer-er-er stemcell paths from Pivotal's s3 bucket (v0.11.9, v0.11.10)
49
+ - Enlarge persistent disk from 4G to 16G (v0.11.11)
50
+ - bosh_cli gems now on rubygems instead of pivotal s3 bucket (v0.11.12)
51
+ - OpenStack improvements to reduce POST API throttling (v0.11.13)
52
+ - Can now update a running microbosh (thanks @lookitup4me) (v0.11.14)
53
+ - OpenStack uses commonly available m1.medium flavor instead of bespoke m1.microbosh (v0.11.14)
54
+ - Properly enlarge persistent disk from 4G to 16G (v0.11.15)
55
+
56
+ v0.10
57
+ -----
45
58
 
46
59
  Available on branch [v0.10](https://github.com/StarkAndWayne/bosh-bootstrap/tree/v0.10).
47
60
 
48
61
  Install using:
49
62
 
50
- gem install bosh-bootstrap -v "~> 0.10.0"
63
+ ```
64
+ gem install bosh-bootstrap -v "~> 0.10.0"
65
+ ```
51
66
 
52
- * Only using latest pre-release bosh gems & stemcells/amis - do not upgrade if you want the old 2012 gems
53
- * AWS us-east-1 uses a pre-built AMI for extra speed
54
- * AWS all regions are working (using pre-created stemcell)
55
- * OpenStack is now working (using pre-created stemcell)
56
- * `deploy --create-inception` chooses to create an inception VM
57
- * Using `bosh_cli_plugin_micro` (for `bosh micro`) [was `bosh_deployer`] (v1.10.1)
58
- * `bosh-cloudfoundry` gem installed with prerelease gems (fix in v0.10.1)
59
- * AWS inception VM gets its attached volume again (v1.10.2)
67
+ - Only using latest pre-release bosh gems & stemcells/amis - do not upgrade if you want the old 2012 gems
68
+ - AWS us-east-1 uses a pre-built AMI for extra speed
69
+ - AWS all regions are working (using pre-created stemcell)
70
+ - OpenStack is now working (using pre-created stemcell)
71
+ - `deploy --create-inception` chooses to create an inception VM
72
+ - Using `bosh_cli_plugin_micro` (for `bosh micro`) [was `bosh_deployer`](v1.10.1)
73
+ - `bosh-cloudfoundry` gem installed with prerelease gems (fix in v0.10.1)
74
+ - AWS inception VM gets its attached volume again (v1.10.2)
60
75
 
61
- ## v0.9
76
+ v0.9
77
+ ----
62
78
 
63
- * v0.8 wasn't working for many people; and neither will v0.9; but its a move in the right direction.
64
- * Moving towards new 1.5.0 version of bosh that hasn't come out yet formally.
65
- * AWS us-east-1 will use a pre-created AMI. It saves about 10-15 minutes!
66
- * AWS other regions will use a pre-created stemcell. I haven't tested this well yet.
67
- * OpenStack support is still broken because you need to create your own stemcells and for that you need a 12.10 inception VM and that work isn't quite done yet.
79
+ - v0.8 wasn't working for many people; and neither will v0.9; but its a move in the right direction.
80
+ - Moving towards new 1.5.0 version of bosh that hasn't come out yet formally.
81
+ - AWS us-east-1 will use a pre-created AMI. It saves about 10-15 minutes!
82
+ - AWS other regions will use a pre-created stemcell. I haven't tested this well yet.
83
+ - OpenStack support is still broken because you need to create your own stemcells and for that you need a 12.10 inception VM and that work isn't quite done yet.
68
84
 
69
- ## v0.8
85
+ v0.8
86
+ ----
70
87
 
71
- * SSH keys used to access inception VM are now generated and stored within the `~/.bosh_bootstrap/ssh` folder. This fixes many issues that many people were having (their keys had passphrases, their fog_default keypair was old). It also allows a manifest file to be shared between people as it contains the private key contents, and the private key file will be recreated if it is missing.
72
- * existing inception VMs' manifest.yml will be upgraded automatically and a backup file created (just in case)
73
- * tightening of net-ssh & net-scp gems to ensure the bosh-bootstrap gem can be installed [thx @mmb]
74
- * preinstall net-ssh/net-scp/fog on inception VM before installing `bosh_deployer` to fix in ability to install `bosh_deployer` 1.4.1 due to latest fog 1.10.0 release (v0.8.2)
88
+ - SSH keys used to access inception VM are now generated and stored within the `~/.bosh_bootstrap/ssh` folder. This fixes many issues that many people were having (their keys had passphrases, their fog_default keypair was old). It also allows a manifest file to be shared between people as it contains the private key contents, and the private key file will be recreated if it is missing.
89
+ - existing inception VMs' manifest.yml will be upgraded automatically and a backup file created (just in case)
90
+ - tightening of net-ssh & net-scp gems to ensure the bosh-bootstrap gem can be installed [thx @mmb]
91
+ - preinstall net-ssh/net-scp/fog on inception VM before installing `bosh_deployer` to fix in ability to install `bosh_deployer` 1.4.1 due to latest fog 1.10.0 release (v0.8.2)
75
92
 
76
- ## v0.7
93
+ v0.7
94
+ ----
77
95
 
78
96
  Notable:
79
97
 
80
- * For existing users: please run "deploy --upgrade-deps" as new inception package (runit) added; and jazor/yaml_command CLIs installed
81
- * Forces use of microbosh stemcell 0.8.1 which work with public gems (latest public stemcell does not work with public gems)
98
+ - For existing users: please run "deploy --upgrade-deps" as new inception package (runit) added; and jazor/yaml_command CLIs installed
99
+ - Forces use of microbosh stemcell 0.8.1 which work with public gems (latest public stemcell does not work with public gems)
82
100
 
83
101
  Added:
84
102
 
85
- * `mosh` command - connect to Inception VM on trains over flaky internet connections (use instead of `ssh` or `tmux` command) [thx @mrdavidlang]
86
- * `upgrade-inception` command - to perform an upgrade of the Inception VM without triggering a re-deploy of microbosh.
103
+ - `mosh` command - connect to Inception VM on trains over flaky internet connections (use instead of `ssh` or `tmux` command) [thx @mrdavidlang]
104
+ - `upgrade-inception` command - to perform an upgrade of the Inception VM without triggering a re-deploy of microbosh.
87
105
 
88
106
  Changes:
89
107
 
90
- * Inception VM now installs rubygems 2.0.0 & bundler 1.3.0
91
- * Better idempotence for re-deploying microbosh - will delete&deploy after a failure; will deploy after a deletion.
92
- * Downloads ubuntu 10.04 ISO to speed up custom stemcell builds
93
- * Using redcard to ensure ruby 1.9 only
94
- * `manifest.yml` stores the name of the stemcell created from a custom stemcell build; no longer re-creates stemcell each time
95
- * git color is enabled on inception VM
108
+ - Inception VM now installs rubygems 2.0.0 & bundler 1.3.0
109
+ - Better idempotence for re-deploying microbosh - will delete&deploy after a failure; will deploy after a deletion.
110
+ - Downloads ubuntu 10.04 ISO to speed up custom stemcell builds
111
+ - Using redcard to ensure ruby 1.9 only
112
+ - `manifest.yml` stores the name of the stemcell created from a custom stemcell build; no longer re-creates stemcell each time
113
+ - git color is enabled on inception VM
96
114
 
97
115
  Work in progress:
98
116
 
99
- * AWS VPC support was begin by the core bosh team; though work has stopped sadly.
100
- * Growing number of specs mostly using Fog.mock! mode; tests being run on travis
117
+ - AWS VPC support was begin by the core bosh team; though work has stopped sadly.
118
+ - Growing number of specs mostly using Fog.mock! mode; tests being run on travis
101
119
 
102
120
  ### v0.7.1
103
121
 
104
- * Make "deploy --private-key" option work [thx @dpw]
105
- * Add hypervisor for OpenStack stemcells [thx @frodenas]
106
- * Don't fail if `settings.fog_credentials.openstack_region` doesn't exist
107
- * Fix README for changed location of bosh-release [thx @scottfrederick]
108
- * No need to show --latest-stemcell in README tutorial
122
+ - Make "deploy --private-key" option work [thx @dpw]
123
+ - Add hypervisor for OpenStack stemcells [thx @frodenas]
124
+ - Don't fail if `settings.fog_credentials.openstack_region` doesn't exist
125
+ - Fix README for changed location of bosh-release [thx @scottfrederick]
126
+ - No need to show --latest-stemcell in README tutorial
109
127
 
110
- ## v0.6
128
+ v0.6
129
+ ----
111
130
 
112
131
  Highlights:
113
132
 
114
- * Defaults to downloading latest stemcell (rather than stable, which are getting old now).
115
- * Installs the Cloud Foundry plugin for bosh https://github.com/StarkAndWayne/bosh-cloudfoundry
133
+ - Defaults to downloading latest stemcell (rather than stable, which are getting old now).
134
+ - Installs the Cloud Foundry plugin for bosh https://github.com/StarkAndWayne/bosh-cloudfoundry
116
135
 
117
136
  Additions:
118
137
 
119
- * `tmux` - if you have tmux installed, then you can SSH into inception VM with it (thx @mrdavidlang)
120
- * started a test suite; its small but growing! (thx @mrdavidlang for getting it started)
138
+ - `tmux` - if you have tmux installed, then you can SSH into inception VM with it (thx @mrdavidlang)
139
+ - started a test suite; its small but growing! (thx @mrdavidlang for getting it started)
121
140
 
122
141
  Bug fixes:
123
142
 
124
- * Fog::SSH uses explicit ssh key that was requested to access inception VM
143
+ - Fog::SSH uses explicit ssh key that was requested to access inception VM
125
144
 
126
145
  Future thoughts:
127
146
 
128
- * I hate Settingslogic for read-write settings. It's really only a read-only settings DSL. It puts Ruby classes into the YAML. Probably going to rip it out.
129
- * I am so sorry I took so long to start writing tests. It always seemed such a hard thing to write tests for. But bosh-cloudfoundry project has had good success with internal tests; so we're migrating those ideas into this project.
147
+ - I hate Settingslogic for read-write settings. It's really only a read-only settings DSL. It puts Ruby classes into the YAML. Probably going to rip it out.
148
+ - I am so sorry I took so long to start writing tests. It always seemed such a hard thing to write tests for. But bosh-cloudfoundry project has had good success with internal tests; so we're migrating those ideas into this project.
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ if File.directory?("../cyoi")
6
6
  gem "cyoi", path: "../cyoi"
7
7
  end
8
8
 
9
+ gem "unf"
9
10
  group :development do
10
11
  gem "awesome_print"
11
12
  gem "rb-fsevent", "~> 0.9.1"
@@ -22,13 +22,13 @@ EOS
22
22
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
23
  gem.require_paths = ["lib"]
24
24
 
25
- gem.add_dependency "cyoi", "~> 0.7"
25
+ gem.add_dependency "cyoi", "~> 0.9.0"
26
26
  gem.add_dependency "fog", "~> 1.11"
27
27
  gem.add_dependency "readwritesettings", "~> 3.0"
28
28
  gem.add_dependency "thor", "~> 0.18"
29
29
  gem.add_dependency "redcard"
30
30
  gem.add_dependency "rbvmomi"
31
31
  gem.add_development_dependency "rake"
32
- gem.add_development_dependency "rspec"
32
+ gem.add_development_dependency "rspec-fire"
33
33
  gem.add_development_dependency "fakeweb"
34
34
  end
@@ -31,7 +31,7 @@ class Bosh::Bootstrap::Cli::Commands::Deploy
31
31
  reload_settings!
32
32
  end
33
33
 
34
- def provider_client
34
+ def cyoi_provider_client
35
35
  @provider_client ||= Cyoi::Providers.provider_client(settings.provider)
36
36
  end
37
37
 
@@ -42,7 +42,7 @@ class Bosh::Bootstrap::Cli::Commands::Deploy
42
42
  reload_settings!
43
43
 
44
44
  # TODO why passing provider_client rather than a Cyoi::Cli::Network object?
45
- network = Bosh::Bootstrap::Network.new(settings.provider.name, provider_client)
45
+ network = Bosh::Bootstrap::Network.new(settings.provider.name, cyoi_provider_client)
46
46
  network.deploy
47
47
  end
48
48
 
@@ -74,4 +74,4 @@ class Bosh::Bootstrap::Cli::Commands::Deploy
74
74
  @microbosh ||= Bosh::Bootstrap::Microbosh.new(settings_dir, microbosh_provider)
75
75
  @microbosh.deploy(settings)
76
76
  end
77
- end
77
+ end
@@ -57,11 +57,7 @@ module Bosh::Bootstrap::MicroboshProviders
57
57
  def security_groups
58
58
  ["ssh",
59
59
  "dns_server",
60
- "bosh_agent_https",
61
- "bosh_nats_server",
62
- "bosh_blobstore",
63
- "bosh_director",
64
- "bosh_registry"]
60
+ "bosh"]
65
61
  end
66
62
 
67
63
  def aws_region
@@ -44,6 +44,10 @@ class Bosh::Bootstrap::MicroboshProviders::Base
44
44
  settings.address.ip
45
45
  end
46
46
 
47
+ def public_ip?
48
+ settings.exists?("address.ip")
49
+ end
50
+
47
51
  def private_key_path
48
52
  settings.key_pair.path
49
53
  end
@@ -30,13 +30,57 @@ module Bosh::Bootstrap::MicroboshProviders
30
30
  })
31
31
  end
32
32
 
33
- # network:
34
- # type: dynamic
35
- # ip: 1.2.3.4
33
+ # For Nova/Floating IP:
34
+ # network:
35
+ # type: dynamic
36
+ # vip: 1.2.3.4
37
+ # For Neutron/Floating IP:
38
+ # network:
39
+ # type: dynamic
40
+ # vip: 1.2.3.4 # public floating IP
41
+ # cloud_properties:
42
+ # net_id: XXX # internal subnet
43
+ # For Neutron/Internal IP:
44
+ # network:
45
+ # type: manual
46
+ # vip: 10.10.10.3 # an IP in subnets range
47
+ # cloud_properties:
48
+ # net_id: XXX # internal subnet
36
49
  def network_configuration
37
- {"type"=>"dynamic",
38
- "vip"=>public_ip
39
- }
50
+ if nova?
51
+ {
52
+ "type"=>"dynamic",
53
+ "vip"=>public_ip
54
+ }
55
+ elsif neutron? && using_external_gateway?
56
+ {
57
+ "type"=>"dynamic",
58
+ "vip"=>public_ip,
59
+ "cloud_properties" => {
60
+ "net_id" => settings.address.subnet_id
61
+ }
62
+ }
63
+ else
64
+ {
65
+ "type"=>"manual",
66
+ "ip"=>public_ip,
67
+ "cloud_properties" => {
68
+ "net_id" => settings.address.subnet_id
69
+ }
70
+ }
71
+ end
72
+ end
73
+
74
+ def nova?
75
+ !neutron?
76
+ end
77
+
78
+ def neutron?
79
+ settings.exists?("address.subnet_id")
80
+ end
81
+
82
+ def using_external_gateway?
83
+ settings.exists?("address.pool_name")
40
84
  end
41
85
 
42
86
  def persistent_disk
@@ -57,7 +101,8 @@ module Bosh::Bootstrap::MicroboshProviders
57
101
  "region"=>region,
58
102
  "default_security_groups"=>security_groups,
59
103
  "default_key_name"=>microbosh_name,
60
- "private_key"=>private_key_path}
104
+ "private_key"=>private_key_path,
105
+ "boot_from_volume"=>boot_from_volume}
61
106
  end
62
107
 
63
108
  def region
@@ -70,11 +115,11 @@ module Bosh::Bootstrap::MicroboshProviders
70
115
  def security_groups
71
116
  ["ssh",
72
117
  "dns_server",
73
- "bosh_agent_https",
74
- "bosh_nats_server",
75
- "bosh_blobstore",
76
- "bosh_director",
77
- "bosh_registry"]
118
+ "bosh"]
119
+ end
120
+
121
+ def boot_from_volume
122
+ !!(settings.provider["options"] && settings.provider.options.boot_from_volume)
78
123
  end
79
124
 
80
125
  def stemcell_uri
@@ -4,11 +4,11 @@ require "bosh-bootstrap/network_providers/dummy"
4
4
  class Bosh::Bootstrap::Network
5
5
 
6
6
  attr_reader :provider_name
7
- attr_reader :provider_client
7
+ attr_reader :cyoi_provider_client
8
8
 
9
- def initialize(provider_name, provider_client)
9
+ def initialize(provider_name, cyoi_provider_client)
10
10
  @provider_name = provider_name
11
- @provider_client = provider_client
11
+ @cyoi_provider_client = cyoi_provider_client
12
12
  end
13
13
 
14
14
  def deploy
@@ -25,9 +25,8 @@ class Bosh::Bootstrap::Network
25
25
  rescue LoadError
26
26
  klass = Bosh::Bootstrap::NetworkProviders.provider_class("dummy")
27
27
  end
28
- klass.new(provider_client)
28
+ klass.new(cyoi_provider_client)
29
29
  end
30
30
  end
31
31
 
32
32
  end
33
-
@@ -1,14 +1,14 @@
1
1
  module Bosh::Bootstrap::NetworkProviders
2
2
  class AWS
3
- attr_reader :provider_client
3
+ attr_reader :cyoi_provider_client
4
4
 
5
- def initialize(provider_client)
6
- @provider_client = provider_client
5
+ def initialize(cyoi_provider_client)
6
+ @cyoi_provider_client = cyoi_provider_client
7
7
  end
8
8
 
9
9
  def perform
10
10
  security_groups.each do |name, ports|
11
- provider_client.create_security_group(name.to_s, name.to_s, ports: ports)
11
+ cyoi_provider_client.create_security_group(name.to_s, name.to_s, ports: ports)
12
12
  end
13
13
  end
14
14
 
@@ -17,11 +17,7 @@ module Bosh::Bootstrap::NetworkProviders
17
17
  {
18
18
  ssh: 22,
19
19
  dns_server: { protocol: "udp", ports: (53..53) },
20
- bosh_nats_server: 4222,
21
- bosh_agent_https: 6868,
22
- bosh_blobstore: 25250,
23
- bosh_director: 25555,
24
- bosh_registry: 25777
20
+ bosh: [4222, 6868, 25250, 25555, 25777]
25
21
  }
26
22
  end
27
23
  end
@@ -1,6 +1,6 @@
1
1
  module Bosh::Bootstrap::NetworkProviders
2
2
  class Dummy
3
- def initialize(provider_client)
3
+ def initialize(cyoi_provider_client)
4
4
  end
5
5
 
6
6
  def perform
@@ -1,29 +1,17 @@
1
1
  module Bosh::Bootstrap::NetworkProviders
2
2
  class OpenStack
3
- attr_reader :provider_client
3
+ attr_reader :cyoi_provider_client
4
4
 
5
- def initialize(provider_client)
6
- @provider_client = provider_client
5
+ def initialize(cyoi_provider_client)
6
+ @cyoi_provider_client = cyoi_provider_client
7
7
  end
8
8
 
9
9
  def perform
10
- security_groups.each do |name, ports|
11
- provider_client.create_security_group(name.to_s, name.to_s, ports: ports)
12
- end
10
+ cyoi_provider_client.create_security_group("ssh", "ssh", 22)
11
+ cyoi_provider_client.create_security_group("dns_server", "dns_server", protocol: "udp", ports: (53..53) )
12
+ cyoi_provider_client.create_security_group("bosh", "bosh", [4222, 6868, 25250, 25555, 25777] )
13
13
  end
14
14
 
15
- protected
16
- def security_groups
17
- {
18
- ssh: 22,
19
- dns_server: { protocol: "udp", ports: (53..53) },
20
- bosh_nats_server: 4222,
21
- bosh_agent_https: 6868,
22
- bosh_blobstore: 25250,
23
- bosh_director: 25555,
24
- bosh_registry: 25777
25
- }
26
- end
27
15
  end
28
16
  end
29
17
  Bosh::Bootstrap::NetworkProviders.register_provider("openstack", Bosh::Bootstrap::NetworkProviders::OpenStack)
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Bootstrap
3
- VERSION = "0.12.0"
3
+ VERSION = "0.13.0"
4
4
  end
5
5
  end
@@ -21,11 +21,7 @@ cloud:
21
21
  default_security_groups:
22
22
  - ssh
23
23
  - dns_server
24
- - bosh_agent_https
25
- - bosh_nats_server
26
- - bosh_blobstore
27
- - bosh_director
28
- - bosh_registry
24
+ - bosh
29
25
  default_key_name: test-bosh
30
26
  ec2_private_key: ~/.microbosh/ssh/test-bosh
31
27
  apply_spec:
@@ -20,11 +20,7 @@ cloud:
20
20
  default_security_groups:
21
21
  - ssh
22
22
  - dns_server
23
- - bosh_agent_https
24
- - bosh_nats_server
25
- - bosh_blobstore
26
- - bosh_director
27
- - bosh_registry
23
+ - bosh
28
24
  default_key_name: test-bosh
29
25
  ec2_private_key: ~/.microbosh/ssh/test-bosh
30
26
  apply_spec:
@@ -22,11 +22,7 @@ cloud:
22
22
  default_security_groups:
23
23
  - ssh
24
24
  - dns_server
25
- - bosh_agent_https
26
- - bosh_nats_server
27
- - bosh_blobstore
28
- - bosh_director
29
- - bosh_registry
25
+ - bosh
30
26
  default_key_name: test-bosh
31
27
  ec2_private_key: ~/.microbosh/ssh/test-bosh
32
28
  apply_spec:
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: test-bosh
3
+ logging:
4
+ level: DEBUG
5
+ network:
6
+ type: manual
7
+ ip: 10.10.10.3
8
+ cloud_properties:
9
+ net_id: 7b8788eb-b49e-4424-9065-75a6b07094ea
10
+ resources:
11
+ persistent_disk: 16384
12
+ cloud_properties:
13
+ instance_type: m1.medium
14
+ cloud:
15
+ plugin: openstack
16
+ properties:
17
+ openstack:
18
+ auth_url: http://10.0.0.2:5000/v2.0/tokens
19
+ username: USER
20
+ api_key: PASSWORD
21
+ tenant: TENANT
22
+ region: REGION
23
+ default_security_groups:
24
+ - ssh
25
+ - dns_server
26
+ - bosh
27
+ default_key_name: test-bosh
28
+ private_key: ~/.microbosh/ssh/test-bosh
29
+ boot_from_volume: true
30
+ apply_spec:
31
+ agent:
32
+ blobstore:
33
+ address: 10.10.10.3
34
+ nats:
35
+ address: 10.10.10.3
36
+ properties:
37
+ director:
38
+ max_threads: 3
39
+ hm:
40
+ resurrector_enabled: true
41
+ ntp:
42
+ - 0.north-america.pool.ntp.org
43
+ - 1.north-america.pool.ntp.org