bosh-bootstrap 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/.travis.yml +0 -1
- data/ChangeLog.md +23 -4
- data/Gemfile +5 -2
- data/Guardfile +2 -0
- data/README.md +209 -197
- data/TODO.md +55 -0
- data/bosh-bootstrap.gemspec +5 -12
- data/lib/bosh/cli/commands/bootstrap.rb +42 -0
- data/lib/bosh-bootstrap/cli/commands/delete.rb +26 -0
- data/lib/bosh-bootstrap/cli/commands/deploy.rb +89 -0
- data/lib/bosh-bootstrap/cli/commands/ssh.rb +32 -0
- data/lib/bosh-bootstrap/cli/helpers/bundle.rb +12 -0
- data/lib/bosh-bootstrap/cli/helpers/interactions.rb +15 -0
- data/lib/bosh-bootstrap/cli/helpers/settings.rb +61 -0
- data/lib/bosh-bootstrap/cli/helpers.rb +11 -0
- data/lib/bosh-bootstrap/key_pair.rb +21 -0
- data/lib/bosh-bootstrap/microbosh.rb +74 -0
- data/lib/bosh-bootstrap/microbosh_providers/aws.rb +104 -0
- data/lib/bosh-bootstrap/microbosh_providers/base.rb +50 -0
- data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +61 -0
- data/lib/bosh-bootstrap/microbosh_providers/vsphere.rb +78 -0
- data/lib/bosh-bootstrap/microbosh_providers.rb +11 -0
- data/lib/bosh-bootstrap/network.rb +33 -0
- data/lib/bosh-bootstrap/network_providers/aws.rb +28 -0
- data/lib/bosh-bootstrap/network_providers/dummy.rb +10 -0
- data/lib/bosh-bootstrap/network_providers/openstack.rb +28 -0
- data/lib/bosh-bootstrap/network_providers.rb +11 -0
- data/lib/bosh-bootstrap/version.rb +1 -1
- data/lib/bosh-bootstrap.rb +3 -4
- data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml +37 -0
- data/spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml +39 -0
- data/spec/assets/microbosh_yml/micro_bosh.openstack.yml +30 -0
- data/spec/assets/microbosh_yml/micro_bosh.vsphere.yml +34 -0
- data/spec/integration/aws/aws_ec2_basic_spec.rb +39 -0
- data/spec/integration/aws/aws_helpers.rb +8 -61
- data/spec/spec_helper.rb +8 -3
- data/spec/support/capture_stdout.rb +18 -0
- data/spec/unit/cli/bootstrap_spec.rb +41 -0
- data/spec/unit/commands/delete_spec.rb +20 -0
- data/spec/unit/commands/deploy_spec.rb +64 -0
- data/spec/unit/commands/ssh_spec.rb +19 -0
- data/spec/unit/key_pair_spec.rb +13 -0
- data/spec/unit/microbosh_providers/aws_spec.rb +68 -0
- data/spec/unit/microbosh_providers/openstack_spec.rb +27 -0
- data/spec/unit/microbosh_providers/vsphere_spec.rb +42 -0
- data/spec/unit/microbosh_spec.rb +27 -0
- data/spec/unit/network_providers/aws_spec.rb +29 -0
- data/spec/unit/network_providers/openstack_spec.rb +29 -0
- data/spec/unit/network_spec.rb +17 -0
- metadata +71 -235
- data/CleanupCi.md +0 -8
- data/bin/bosh-bootstrap +0 -8
- data/docs/README.md +0 -3
- data/docs/devstack-openstack-tutorial.md +0 -215
- data/lib/bosh/providers/README.md +0 -5
- data/lib/bosh/providers/aws.rb +0 -258
- data/lib/bosh/providers/base_provider.rb +0 -48
- data/lib/bosh/providers/openstack.rb +0 -79
- data/lib/bosh/providers.rb +0 -21
- data/lib/bosh-bootstrap/cli.rb +0 -1347
- data/lib/bosh-bootstrap/commander/README.md +0 -47
- data/lib/bosh-bootstrap/commander/command.rb +0 -25
- data/lib/bosh-bootstrap/commander/commands.rb +0 -80
- data/lib/bosh-bootstrap/commander/local_server.rb +0 -68
- data/lib/bosh-bootstrap/commander/remote_script_command.rb +0 -51
- data/lib/bosh-bootstrap/commander/remote_server.rb +0 -137
- data/lib/bosh-bootstrap/commander/upload_command.rb +0 -17
- data/lib/bosh-bootstrap/commander.rb +0 -9
- data/lib/bosh-bootstrap/helpers/fog_setup.rb +0 -50
- data/lib/bosh-bootstrap/helpers/settings.rb +0 -99
- data/lib/bosh-bootstrap/helpers/settings_setter.rb +0 -41
- data/lib/bosh-bootstrap/helpers.rb +0 -3
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete/bosh_micro_delete +0 -19
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete.rb +0 -90
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/bosh_micro_deploy +0 -79
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/install_key_pair_for_user +0 -23
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy.rb +0 -146
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_download/download_micro_bosh_stemcell +0 -93
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_download.rb +0 -139
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/configure_git +0 -25
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/create_vcap_user +0 -79
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_base_packages +0 -30
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh +0 -11
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh_plugins +0 -25
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_hub +0 -26
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby +0 -30
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_useful_gems +0 -29
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/validate_bosh_deployer +0 -18
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm.rb +0 -69
- data/lib/bosh-bootstrap/stages/stage_salted_password/convert_salted_password +0 -11
- data/lib/bosh-bootstrap/stages/stage_salted_password.rb +0 -51
- data/lib/bosh-bootstrap/stages/stage_setup_new_bosh/setup_bosh_user +0 -29
- data/lib/bosh-bootstrap/stages/stage_setup_new_bosh.rb +0 -51
- data/lib/bosh-bootstrap/stages/stage_validate_inception_vm/validate_ubuntu +0 -6
- data/lib/bosh-bootstrap/stages/stage_validate_inception_vm.rb +0 -39
- data/lib/bosh-bootstrap/stages.rb +0 -10
- data/spec/assets/bosh/public_stemcells/aws_micro.out +0 -7
- data/spec/assets/micro_bosh_yml/micro_bosh.aws_ec2.yml +0 -35
- data/spec/assets/micro_bosh_yml/micro_bosh.aws_vpc.yml +0 -37
- data/spec/integration/aws/aws_basic_spec.rb +0 -39
- data/spec/integration/aws/aws_edge_prebuilt_ami_spec.rb +0 -46
- data/spec/integration/aws/aws_edge_prebuilt_spec.rb +0 -46
- data/spec/integration/aws/aws_edge_spec.rb +0 -45
- data/spec/unit/aws_spec.rb +0 -177
- data/spec/unit/bosh/providers/aws_spec.rb +0 -174
- data/spec/unit/cli_spec.rb +0 -134
- data/spec/unit/cli_ssh_spec.rb +0 -95
- data/spec/unit/cli_upgrade_inception_spec.rb +0 -29
- data/spec/unit/settings_setter_spec.rb +0 -29
- data/vendor/cache/POpen4-0.1.4.gem +0 -0
- data/vendor/cache/Platform-0.4.0.gem +0 -0
- data/vendor/cache/activesupport-3.2.8.gem +0 -0
- data/vendor/cache/awesome_print-1.1.0.gem +0 -0
- data/vendor/cache/aws-s3-0.6.3.gem +0 -0
- data/vendor/cache/blobstore_client-0.4.0.gem +0 -0
- data/vendor/cache/bosh_cli-1.0.3.gem +0 -0
- data/vendor/cache/bosh_common-0.5.4.gem +0 -0
- data/vendor/cache/builder-3.2.0.gem +0 -0
- data/vendor/cache/coderay-1.0.8.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
- data/vendor/cache/escape-0.0.4.gem +0 -0
- data/vendor/cache/excon-0.20.1.gem +0 -0
- data/vendor/cache/fog-1.8.0.gem +0 -0
- data/vendor/cache/formatador-0.2.4.gem +0 -0
- data/vendor/cache/guard-1.6.2.gem +0 -0
- data/vendor/cache/guard-rspec-2.4.0.gem +0 -0
- data/vendor/cache/highline-1.6.18.gem +0 -0
- data/vendor/cache/httpclient-2.2.4.gem +0 -0
- data/vendor/cache/i18n-0.6.1.gem +0 -0
- data/vendor/cache/json_pure-1.6.8.gem +0 -0
- data/vendor/cache/listen-0.7.2.gem +0 -0
- data/vendor/cache/log4r-1.1.10.gem +0 -0
- data/vendor/cache/lumberjack-1.0.2.gem +0 -0
- data/vendor/cache/method_source-0.8.1.gem +0 -0
- data/vendor/cache/mime-types-1.22.gem +0 -0
- data/vendor/cache/multi_json-1.1.0.gem +0 -0
- data/vendor/cache/net-scp-1.0.4.gem +0 -0
- data/vendor/cache/net-ssh-2.2.2.gem +0 -0
- data/vendor/cache/net-ssh-gateway-1.1.0.gem +0 -0
- data/vendor/cache/netaddr-1.5.0.gem +0 -0
- data/vendor/cache/nokogiri-1.5.9.gem +0 -0
- data/vendor/cache/open4-1.3.0.gem +0 -0
- data/vendor/cache/progressbar-0.9.2.gem +0 -0
- data/vendor/cache/pry-0.9.11.4-java.gem +0 -0
- data/vendor/cache/pry-0.9.11.4.gem +0 -0
- data/vendor/cache/rake-10.0.3.gem +0 -0
- data/vendor/cache/rb-fsevent-0.9.3.gem +0 -0
- data/vendor/cache/redcard-1.0.0.gem +0 -0
- data/vendor/cache/rspec-2.12.0.gem +0 -0
- data/vendor/cache/rspec-core-2.12.2.gem +0 -0
- data/vendor/cache/rspec-expectations-2.12.1.gem +0 -0
- data/vendor/cache/rspec-mocks-2.12.2.gem +0 -0
- data/vendor/cache/ruby-atmos-pure-1.0.5.gem +0 -0
- data/vendor/cache/ruby-hmac-0.4.0.gem +0 -0
- data/vendor/cache/settingslogic-2.0.9.gem +0 -0
- data/vendor/cache/slop-3.4.3.gem +0 -0
- data/vendor/cache/spoon-0.0.1.gem +0 -0
- data/vendor/cache/terminal-table-1.4.5.gem +0 -0
- data/vendor/cache/thor-0.17.0.gem +0 -0
- data/vendor/cache/uuidtools-2.1.3.gem +0 -0
- data/vendor/cache/xml-simple-1.1.2.gem +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
# Copyright (c) 2012-2013 Stark & Wayne, LLC
|
2
|
+
|
3
|
+
require "bosh-bootstrap/cli/commands/deploy"
|
4
|
+
require "cyoi/providers/clients/aws_provider_client"
|
5
|
+
describe Bosh::Bootstrap::Cli::Commands::Deploy do
|
6
|
+
include StdoutCapture
|
7
|
+
include Bosh::Bootstrap::Cli::Helpers
|
8
|
+
|
9
|
+
let(:settings_dir) { File.expand_path("~/.microbosh") }
|
10
|
+
|
11
|
+
before do
|
12
|
+
FileUtils.mkdir_p(@stemcells_dir = File.join(Dir.mktmpdir, "stemcells"))
|
13
|
+
FileUtils.mkdir_p(@cache_dir = File.join(Dir.mktmpdir, "cache"))
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:cmd) { Bosh::Bootstrap::Cli::Commands::Deploy.new }
|
17
|
+
|
18
|
+
# * select_provider
|
19
|
+
# * select_or_provision_public_networking # public_ip or ip/network/gateway
|
20
|
+
# * select_public_image_or_download_stemcell # download if stemcell
|
21
|
+
# * create_microbosh_manifest
|
22
|
+
# * microbosh_deploy
|
23
|
+
describe "aws" do
|
24
|
+
it "deploy creates provisions IP address micro_bosh.yml, discovers/downloads stemcell/AMI, runs 'bosh micro deploy'" do
|
25
|
+
setting "provider.name", "aws"
|
26
|
+
setting "key_pair.name", "test-bosh"
|
27
|
+
setting "key_pair.private_key", "PRIVATE"
|
28
|
+
|
29
|
+
provider = double(Cyoi::Cli::Provider)
|
30
|
+
provider.stub(:execute!)
|
31
|
+
Cyoi::Cli::Provider.should_receive(:new).with([settings_dir]).and_return(provider)
|
32
|
+
|
33
|
+
provider_client = double(Cyoi::Providers::Clients::AwsProviderClient)
|
34
|
+
provider_client.stub(:create_security_group)
|
35
|
+
cmd.stub(:provider_client).and_return(provider_client)
|
36
|
+
|
37
|
+
address = double(Cyoi::Cli::Address)
|
38
|
+
address.stub(:execute!)
|
39
|
+
Cyoi::Cli::Address.should_receive(:new).with([settings_dir]).and_return(address)
|
40
|
+
|
41
|
+
microbosh_provider = stub()
|
42
|
+
microbosh_provider.should_receive(:stemcell).exactly(1).times.and_return("")
|
43
|
+
microbosh_provider.should_receive(:stemcell).exactly(1).times.and_return("ami-123456")
|
44
|
+
cmd.stub(:microbosh_provider).and_return(microbosh_provider)
|
45
|
+
|
46
|
+
key_pair = double(Cyoi::Cli::KeyPair)
|
47
|
+
key_pair.stub(:execute!)
|
48
|
+
Cyoi::Cli::KeyPair.should_receive(:new).with(["test-bosh", settings_dir]).and_return(key_pair)
|
49
|
+
|
50
|
+
keypair = double(Bosh::Bootstrap::KeyPair)
|
51
|
+
keypair.should_receive(:execute!)
|
52
|
+
keypair.should_receive(:path).and_return(home_file(".microbosh/ssh/test-bosh"))
|
53
|
+
Bosh::Bootstrap::KeyPair.stub(:new).with(settings_dir, "test-bosh", "PRIVATE").and_return(keypair)
|
54
|
+
|
55
|
+
microbosh = double(Bosh::Bootstrap::Microbosh)
|
56
|
+
microbosh.stub(:deploy)
|
57
|
+
Bosh::Bootstrap::Microbosh.stub(:new).with(settings_dir, microbosh_provider).and_return(microbosh)
|
58
|
+
|
59
|
+
capture_stdout { cmd.perform }
|
60
|
+
end
|
61
|
+
it "delete does nothing if not targetting a deployment"
|
62
|
+
it "delete runs 'bosh micro delete' & releases IP address; updates settings"
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Copyright (c) 2012-2013 Stark & Wayne, LLC
|
2
|
+
|
3
|
+
require "bosh-bootstrap/cli/commands/ssh"
|
4
|
+
|
5
|
+
describe Bosh::Bootstrap::Cli::Commands::SSH do
|
6
|
+
include StdoutCapture
|
7
|
+
include Bosh::Bootstrap::Cli::Helpers
|
8
|
+
|
9
|
+
let(:settings_dir) { File.expand_path("~/.microbosh") }
|
10
|
+
|
11
|
+
subject { Bosh::Bootstrap::Cli::Commands::SSH.new }
|
12
|
+
|
13
|
+
it "runs ssh" do
|
14
|
+
setting "address.ip", "1.2.3.4"
|
15
|
+
setting "key_pair.path", "/path/to/private/key"
|
16
|
+
subject.should_receive(:sh).with("ssh -i /path/to/private/key vcap@1.2.3.4")
|
17
|
+
subject.perform
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
describe Bosh::Bootstrap::KeyPair do
|
2
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
3
|
+
|
4
|
+
subject { Bosh::Bootstrap::KeyPair.new(settings_dir, "keyname", "PRIVATE") }
|
5
|
+
|
6
|
+
it "creates local private key file" do
|
7
|
+
setup_home_dir
|
8
|
+
File.should_not be_exists(home_file(".microbosh", "ssh", "keyname"))
|
9
|
+
subject.execute!
|
10
|
+
keyfile = home_file(".microbosh", "ssh", "keyname")
|
11
|
+
File.read(keyfile).should == "PRIVATE"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
require "fakeweb"
|
3
|
+
require "bosh-bootstrap/microbosh_providers/aws"
|
4
|
+
|
5
|
+
describe Bosh::Bootstrap::MicroboshProviders::AWS do
|
6
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
7
|
+
|
8
|
+
let(:microbosh_yml) { File.expand_path("~/.microbosh/deployments/micro_bosh.yml")}
|
9
|
+
let(:aws_jenkins_bucket) { "bosh-jenkins-artifacts" }
|
10
|
+
let(:latest_ami_uri) { "http://#{aws_jenkins_bucket}.s3.amazonaws.com/last_successful_micro-bosh-stemcell-aws_ami_us-east-1" }
|
11
|
+
let(:latest_stemcell_uri) { "http://#{aws_jenkins_bucket}.s3.amazonaws.com/last_successful_micro-bosh-stemcell-aws.tgz" }
|
12
|
+
|
13
|
+
it "creates micro_bosh.yml manifest" do
|
14
|
+
setting "provider.name", "aws"
|
15
|
+
setting "provider.region", "us-west-2"
|
16
|
+
setting "provider.credentials.aws_access_key_id", "ACCESS"
|
17
|
+
setting "provider.credentials.aws_secret_access_key", "SECRET"
|
18
|
+
setting "address.ip", "1.2.3.4"
|
19
|
+
setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
|
20
|
+
setting "bosh.name", "test-bosh"
|
21
|
+
setting "bosh.salted_password", "salted_password"
|
22
|
+
setting "bosh.persistent_disk", 16384
|
23
|
+
|
24
|
+
subject = Bosh::Bootstrap::MicroboshProviders::AWS.new(microbosh_yml, settings)
|
25
|
+
|
26
|
+
subject.create_microbosh_yml(settings)
|
27
|
+
File.should be_exists(microbosh_yml)
|
28
|
+
files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.aws_ec2.yml"))
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "stemcell" do
|
32
|
+
before do
|
33
|
+
setting "provider.name", "aws"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "is an AMI if us-east-1 target region" do
|
37
|
+
setting "provider.region", "us-east-1"
|
38
|
+
FakeWeb.register_uri(:get, latest_ami_uri, body: "ami-234567")
|
39
|
+
|
40
|
+
subject = Bosh::Bootstrap::MicroboshProviders::AWS.new(microbosh_yml, settings)
|
41
|
+
subject.stemcell.should == "ami-234567"
|
42
|
+
end
|
43
|
+
|
44
|
+
it "retries to get AMI if initially fails" do
|
45
|
+
setting "provider.region", "us-east-1"
|
46
|
+
FakeWeb.register_uri(:get, latest_ami_uri, [
|
47
|
+
{ status: 404 },
|
48
|
+
{ body: "ami-234567"}
|
49
|
+
])
|
50
|
+
|
51
|
+
subject = Bosh::Bootstrap::MicroboshProviders::AWS.new(microbosh_yml, settings)
|
52
|
+
subject.stemcell.should == ""
|
53
|
+
subject.stemcell.should == "ami-234567"
|
54
|
+
end
|
55
|
+
|
56
|
+
xit "errors if AMI not available and not running within target region" do
|
57
|
+
setting "provider.region", "us-west-2"
|
58
|
+
end
|
59
|
+
|
60
|
+
it "downloads latest stemcell and returns path if running in target AWS region" do
|
61
|
+
setting "provider.region", "us-west-2"
|
62
|
+
|
63
|
+
subject = Bosh::Bootstrap::MicroboshProviders::AWS.new(microbosh_yml, settings)
|
64
|
+
subject.stub(:sh).with("curl -O '#{latest_stemcell_uri}'")
|
65
|
+
subject.stemcell.should =~ %r{deployments/last_successful_micro-bosh-stemcell-aws.tgz$}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
require "bosh-bootstrap/microbosh_providers/openstack"
|
3
|
+
|
4
|
+
describe Bosh::Bootstrap::MicroboshProviders::OpenStack do
|
5
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
6
|
+
|
7
|
+
let(:microbosh_yml) { File.expand_path("~/.microbosh/deployments/micro_bosh.yml")}
|
8
|
+
|
9
|
+
it "creates micro_bosh.yml manifest" do
|
10
|
+
setting "provider.name", "openstack"
|
11
|
+
setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
|
12
|
+
setting "provider.credentials.openstack_username", "USER"
|
13
|
+
setting "provider.credentials.openstack_api_key", "PASSWORD"
|
14
|
+
setting "provider.credentials.openstack_tenant", "TENANT"
|
15
|
+
setting "address.ip", "1.2.3.4"
|
16
|
+
setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
|
17
|
+
setting "bosh.name", "test-bosh"
|
18
|
+
setting "bosh.salted_password", "salted_password"
|
19
|
+
setting "bosh.persistent_disk", 4096
|
20
|
+
|
21
|
+
subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings)
|
22
|
+
|
23
|
+
subject.create_microbosh_yml(settings)
|
24
|
+
File.should be_exists(microbosh_yml)
|
25
|
+
files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.yml"))
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
require "bosh-bootstrap/microbosh_providers/vsphere"
|
3
|
+
|
4
|
+
describe Bosh::Bootstrap::MicroboshProviders::VSphere do
|
5
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
6
|
+
|
7
|
+
let(:microbosh_yml) { File.expand_path("~/.microbosh/deployments/micro_bosh.yml")}
|
8
|
+
|
9
|
+
it "creates micro_bosh.yml manifest" do
|
10
|
+
setting "provider.name", "vsphere"
|
11
|
+
setting "provider.credentials.host", "HOST"
|
12
|
+
setting "provider.credentials.user", "user"
|
13
|
+
setting "provider.credentials.password", "TempP@ss"
|
14
|
+
|
15
|
+
# TODO - perhaps network.ip_address is better?
|
16
|
+
setting "address.ip", "172.23.194.100"
|
17
|
+
setting "provider.network.name", "VLAN2194"
|
18
|
+
setting "provider.network.netmask", "255.255.254.0"
|
19
|
+
setting "provider.network.gateway", "172.23.194.1"
|
20
|
+
setting "provider.network.dns", %w[172.22.22.153 172.22.22.154]
|
21
|
+
|
22
|
+
setting "provider.npt", %w[ntp01.las01.emcatmos.com ntp02.las01.emcatmos.com]
|
23
|
+
setting "provider.datacenter.name", "LAS01"
|
24
|
+
setting "provider.datacenter.vm_folder", "BOSH_VMs"
|
25
|
+
setting "provider.datacenter.template_folder", "BOSH_Templates"
|
26
|
+
setting "provider.datacenter.disk_path", "BOSH_Deployer"
|
27
|
+
setting "provider.datacenter.datastore_pattern", "las01-.*"
|
28
|
+
setting "provider.datacenter.persistent_datastore_pattern", "las01-.*"
|
29
|
+
setting "provider.datacenter.allow_mixed_datastores", true
|
30
|
+
setting "provider.datacenter.clusters", ["CLUSTER01"]
|
31
|
+
|
32
|
+
setting "bosh.name", "test-bosh"
|
33
|
+
setting "bosh.password", "password"
|
34
|
+
setting "bosh.salted_password", "salted_password"
|
35
|
+
|
36
|
+
subject = Bosh::Bootstrap::MicroboshProviders::VSphere.new(microbosh_yml, settings)
|
37
|
+
|
38
|
+
subject.create_microbosh_yml(settings)
|
39
|
+
File.should be_exists(microbosh_yml)
|
40
|
+
files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.vsphere.yml"))
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
|
3
|
+
describe Bosh::Bootstrap::Microbosh do
|
4
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
5
|
+
|
6
|
+
let(:path_or_ami) { "/path/to/stemcell.tgz" }
|
7
|
+
let(:base_path) { File.expand_path("~/.microbosh") }
|
8
|
+
let(:settings_dir) { base_path }
|
9
|
+
let(:microbosh_provider) { stub(create_microbosh_yml: {}) }
|
10
|
+
subject { Bosh::Bootstrap::Microbosh.new(base_path, microbosh_provider) }
|
11
|
+
|
12
|
+
it "deploys new microbosh" do
|
13
|
+
setting "bosh.name", "test-bosh"
|
14
|
+
setting "bosh.stemcell", path_or_ami
|
15
|
+
subject.should_receive(:sh).with("bundle install")
|
16
|
+
subject.should_receive(:sh).with("bundle exec bosh micro deployment test-bosh")
|
17
|
+
subject.should_receive(:sh).with("bundle exec bosh -n micro deploy #{path_or_ami}")
|
18
|
+
subject.deploy(settings)
|
19
|
+
end
|
20
|
+
|
21
|
+
xit "updates existing microbosh" do
|
22
|
+
subject.deploy
|
23
|
+
end
|
24
|
+
xit "re-deploys failed microbosh deployment" do
|
25
|
+
subject.deploy
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
require "fakeweb"
|
3
|
+
require "bosh-bootstrap/network_providers/aws"
|
4
|
+
|
5
|
+
describe Bosh::Bootstrap::NetworkProviders::AWS do
|
6
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
7
|
+
|
8
|
+
let(:provider_client) { stub() }
|
9
|
+
subject { Bosh::Bootstrap::NetworkProviders::AWS.new(provider_client) }
|
10
|
+
|
11
|
+
it "is registered" do
|
12
|
+
Bosh::Bootstrap::NetworkProviders.provider_class("aws").should == subject.class
|
13
|
+
end
|
14
|
+
|
15
|
+
it "creates security groups it needs" do
|
16
|
+
expected_groups = [
|
17
|
+
["ssh", "ssh", ports: 22],
|
18
|
+
["bosh_nats_server", "bosh_nats_server", ports: 4222],
|
19
|
+
["bosh_agent_http", "bosh_agent_http", ports: 6868],
|
20
|
+
["bosh_blobstore", "bosh_blobstore", ports: 25250],
|
21
|
+
["bosh_director", "bosh_director", ports: 25555],
|
22
|
+
["bosh_registry", "bosh_registry", ports: 25777],
|
23
|
+
]
|
24
|
+
expected_groups.each do |security_group_name, description, ports|
|
25
|
+
provider_client.stub(:create_security_group).with(security_group_name, description, ports)
|
26
|
+
end
|
27
|
+
subject.perform
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "readwritesettings"
|
2
|
+
require "fakeweb"
|
3
|
+
require "bosh-bootstrap/network_providers/openstack"
|
4
|
+
|
5
|
+
describe Bosh::Bootstrap::NetworkProviders::OpenStack do
|
6
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
7
|
+
|
8
|
+
let(:provider_client) { stub() }
|
9
|
+
subject { Bosh::Bootstrap::NetworkProviders::OpenStack.new(provider_client) }
|
10
|
+
|
11
|
+
it "is registered" do
|
12
|
+
Bosh::Bootstrap::NetworkProviders.provider_class("openstack").should == subject.class
|
13
|
+
end
|
14
|
+
|
15
|
+
it "creates security groups it needs" do
|
16
|
+
expected_groups = [
|
17
|
+
["ssh", "ssh", 22],
|
18
|
+
["bosh_nats_server", "bosh_nats_server", 4222],
|
19
|
+
["bosh_agent_http", "bosh_agent_http", 6868],
|
20
|
+
["bosh_blobstore", "bosh_blobstore", 25250],
|
21
|
+
["bosh_director", "bosh_director", 25555],
|
22
|
+
["bosh_registry", "bosh_registry", 25777],
|
23
|
+
]
|
24
|
+
expected_groups.each do |security_group_name, description, ports|
|
25
|
+
provider_client.stub(:create_security_group).with(security_group_name, description, ports)
|
26
|
+
end
|
27
|
+
subject.perform
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe Bosh::Bootstrap::Network do
|
2
|
+
include Bosh::Bootstrap::Cli::Helpers::Settings
|
3
|
+
|
4
|
+
let(:aws_provider_client) { stub() }
|
5
|
+
let(:vsphere_provider_client) { stub() }
|
6
|
+
|
7
|
+
it "uses NetworkProvider if available" do
|
8
|
+
network = Bosh::Bootstrap::Network.new("aws", aws_provider_client)
|
9
|
+
aws_provider_client.should_receive(:create_security_group).exactly(6).times
|
10
|
+
network.deploy
|
11
|
+
end
|
12
|
+
|
13
|
+
it "does nothing if no NetworkProvider for the infrastructure" do
|
14
|
+
network = Bosh::Bootstrap::Network.new("vsphere", vsphere_provider_client)
|
15
|
+
network.deploy
|
16
|
+
end
|
17
|
+
end
|