bosh-bootstrap 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +9 -0
  3. data/lib/bosh-bootstrap/microbosh_providers/aws.rb +1 -1
  4. data/lib/bosh-bootstrap/microbosh_providers/base.rb +21 -8
  5. data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +1 -2
  6. data/lib/bosh-bootstrap/microbosh_providers/vsphere.rb +1 -8
  7. data/lib/bosh-bootstrap/version.rb +1 -1
  8. data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.us-west-2a.yml +7 -0
  9. data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml +7 -0
  10. data/spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml +7 -0
  11. data/spec/assets/microbosh_yml/micro_bosh.aws_vpc_proxy.yml +7 -0
  12. data/spec/assets/microbosh_yml/micro_bosh.aws_vpc_recursor.yml +7 -0
  13. data/spec/assets/microbosh_yml/micro_bosh.base.with_ntp.yml +16 -0
  14. data/spec/assets/microbosh_yml/micro_bosh.base.with_recursor.yml +9 -0
  15. data/spec/assets/microbosh_yml/micro_bosh.base.without_recursor.yml +12 -0
  16. data/spec/assets/microbosh_yml/micro_bosh.openstack.boot_from_volume.yml +6 -2
  17. data/spec/assets/microbosh_yml/micro_bosh.openstack.neutron_manual.yml +6 -2
  18. data/spec/assets/microbosh_yml/micro_bosh.openstack.neutron_vip.yml +6 -2
  19. data/spec/assets/microbosh_yml/micro_bosh.openstack.nova_vip.yml +6 -2
  20. data/spec/assets/microbosh_yml/micro_bosh.openstack.with_ntp.yml +50 -0
  21. data/spec/assets/microbosh_yml/micro_bosh.openstack.with_proxy.yml +10 -6
  22. data/spec/assets/microbosh_yml/micro_bosh.openstack.with_recursor.yml +10 -6
  23. data/spec/assets/microbosh_yml/micro_bosh.openstack.with_state_timeout.yml +10 -6
  24. data/spec/assets/microbosh_yml/micro_bosh.vsphere.yml +5 -0
  25. data/spec/unit/microbosh_providers/base_spec.rb +23 -2
  26. data/spec/unit/microbosh_providers/openstack_spec.rb +80 -129
  27. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f129c85103167ccb50440635ccefbe5f634ddfa
4
- data.tar.gz: 2aa8af1494084d8b3b7dbd5368ff6eb7344ee01f
3
+ metadata.gz: c61c217989397d0bca3717c0d36a62aba8109aa0
4
+ data.tar.gz: c438b5db3aafbc87841888afa404d49b4d284145
5
5
  SHA512:
6
- metadata.gz: 0b227ca0fe620f38e53aab4c348cdffd165a8da1215f558c7f70dcb95dfb55d9e6a3d9d971cf2a9348da1481dafe3115519941719a2ccf2a07846b1014d5284f
7
- data.tar.gz: fac9a391364bf0eddc4513f1176440eec5b6af4356b891c7ea8bc8e4e6f00973575a0e2f925c4f05d9d0c9b5ef6d8f600a6fbb8ca286b36b7b6c0f5f225d1121
6
+ metadata.gz: 4d2cbbfb92b901dcc569ded5f4378c0b2b581d15a975440a22ffd9440617932e8d03ac6f8bd2b8a3290b1ef6a828ccefa9ef6650424faa195cff5a2589d849b1
7
+ data.tar.gz: 80acb62e9ccf7521b3f2f29c152db715790b5b8ca90b23775edc90e550cdbaf320b5b7d5c52d6361dd971bd6490c8aa7eab0c7752889be076705bf2419208ef8
data/ChangeLog.md CHANGED
@@ -8,6 +8,15 @@ gem install bosh-bootstrap
8
8
  bosh-bootstrap deploy
9
9
  ```
10
10
 
11
+ v0.18
12
+ -----
13
+ - [aws-openstack] added support for custom ntp servers
14
+ - [all] configure ntp for microbosh VM as well as for VM's spawned by the director
15
+
16
+ v0.17.1
17
+ -------
18
+ - use light stemcells by default in aws
19
+
11
20
  v0.17
12
21
  -----
13
22
  - [aws-openstack] Added proxy support
@@ -4,7 +4,7 @@ module Bosh::Bootstrap::MicroboshProviders
4
4
  class AWS < Base
5
5
 
6
6
  def to_hash
7
- data = super.merge({
7
+ data = super.deep_merge({
8
8
  "network"=>network_configuration,
9
9
  "resources"=>
10
10
  {"persistent_disk"=>persistent_disk,
@@ -8,6 +8,8 @@ require "rake/file_utils"
8
8
  class Bosh::Bootstrap::MicroboshProviders::Base
9
9
  include FileUtils
10
10
 
11
+ DEFAULT_NTP_SERVERS = %w[0.pool.ntp.org 1.pool.ntp.org]
12
+
11
13
  attr_reader :manifest_path
12
14
  attr_reader :settings
13
15
  attr_reader :fog_compute
@@ -31,7 +33,7 @@ class Bosh::Bootstrap::MicroboshProviders::Base
31
33
  def to_hash
32
34
  {"name"=>microbosh_name,
33
35
  "logging"=>{"level"=>"DEBUG"},
34
- }.merge(default_apply_spec)
36
+ }.merge(default_spec)
35
37
  end
36
38
 
37
39
  def microbosh_name
@@ -63,6 +65,13 @@ class Bosh::Bootstrap::MicroboshProviders::Base
63
65
  settings.exists?("proxy")
64
66
  end
65
67
 
68
+ def ntp_servers
69
+ servers = DEFAULT_NTP_SERVERS
70
+ servers = settings.provider.ntps if settings.exists?("provider.ntps")
71
+ servers = settings.ntp if settings.exists?("ntp")
72
+ return servers.is_a?(String) ? servers.split(",") : servers
73
+ end
74
+
66
75
  def jenkins_bucket
67
76
  "bosh-jenkins-artifacts"
68
77
  end
@@ -105,13 +114,17 @@ class Bosh::Bootstrap::MicroboshProviders::Base
105
114
  File.dirname(manifest_path)
106
115
  end
107
116
 
108
- def default_apply_spec
109
- return {} unless settings.exists?("recursor")
110
- {"apply_spec"=>
111
- {"properties"=>
112
- {"dns"=>{
113
- "recursor"=>settings.recursor} }
114
- }
117
+ def default_spec
118
+ spec = {
119
+ "cloud" => { "properties" => { "agent" => { "ntp" => ntp_servers } } },
120
+ "apply_spec" => { "properties" => { "ntp" => ntp_servers } }
115
121
  }
122
+
123
+ if settings.exists?("recursor")
124
+ spec["apply_spec"]["properties"]["dns"] = {
125
+ "recursor" => settings.recursor
126
+ }
127
+ end
128
+ spec
116
129
  end
117
130
  end
@@ -20,8 +20,7 @@ module Bosh::Bootstrap::MicroboshProviders
20
20
  "properties"=>
21
21
  {"director"=>
22
22
  {"max_threads"=>3},
23
- "hm"=>{"resurrector_enabled" => true},
24
- "ntp"=>["0.north-america.pool.ntp.org","1.north-america.pool.ntp.org"]}}
23
+ "hm"=>{"resurrector_enabled" => true}}}
25
24
  })
26
25
  if proxy?
27
26
  data["apply_spec"]["properties"]["director"]["env"] = proxy
@@ -9,13 +9,12 @@ module Bosh::Bootstrap::MicroboshProviders
9
9
  end
10
10
 
11
11
  def to_hash
12
- super.merge({
12
+ super.deep_merge({
13
13
  "network" => network_configuration,
14
14
  "resources" => resource_configuration,
15
15
  "cloud"=>
16
16
  {"plugin"=>"vsphere",
17
17
  "properties"=>{
18
- "agent"=>{"ntp"=>ntps},
19
18
  "vcenters"=>[vcenter_configuration]
20
19
  }}})
21
20
  end
@@ -60,12 +59,6 @@ module Bosh::Bootstrap::MicroboshProviders
60
59
  }
61
60
  end
62
61
 
63
- def ntps
64
- ntp_servers = settings.provider.ntps
65
- ntp_servers = ntp_servers.split(",") if ntp_servers.is_a?(String)
66
- ntp_servers
67
- end
68
-
69
62
  # vcenters:
70
63
  # - host: HOST
71
64
  # user: dev\cloudfoundry-auth
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Bootstrap
3
- VERSION = "0.17.1"
3
+ VERSION = "0.18.0"
4
4
  end
5
5
  end
@@ -27,6 +27,10 @@ cloud:
27
27
  - bosh
28
28
  default_key_name: test-bosh
29
29
  ec2_private_key: ~/.microbosh/ssh/test-bosh
30
+ agent:
31
+ ntp:
32
+ - 0.pool.ntp.org
33
+ - 1.pool.ntp.org
30
34
  apply_spec:
31
35
  agent:
32
36
  blobstore:
@@ -38,3 +42,6 @@ apply_spec:
38
42
  resurrector_enabled: true
39
43
  aws_registry:
40
44
  address: 1.2.3.4
45
+ ntp:
46
+ - 0.pool.ntp.org
47
+ - 1.pool.ntp.org
@@ -26,6 +26,10 @@ cloud:
26
26
  - bosh
27
27
  default_key_name: test-bosh
28
28
  ec2_private_key: ~/.microbosh/ssh/test-bosh
29
+ agent:
30
+ ntp:
31
+ - 0.pool.ntp.org
32
+ - 1.pool.ntp.org
29
33
  apply_spec:
30
34
  agent:
31
35
  blobstore:
@@ -37,3 +41,6 @@ apply_spec:
37
41
  resurrector_enabled: true
38
42
  aws_registry:
39
43
  address: 1.2.3.4
44
+ ntp:
45
+ - 0.pool.ntp.org
46
+ - 1.pool.ntp.org
@@ -30,6 +30,10 @@ cloud:
30
30
  - bosh-vpc-123456
31
31
  default_key_name: test-bosh
32
32
  ec2_private_key: ~/.microbosh/ssh/test-bosh
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -43,3 +47,6 @@ apply_spec:
43
47
  address: 1.2.3.4
44
48
  dns:
45
49
  recursor: 1.2.0.2
50
+ ntp:
51
+ - 0.pool.ntp.org
52
+ - 1.pool.ntp.org
@@ -30,6 +30,10 @@ cloud:
30
30
  - bosh-vpc-123456
31
31
  default_key_name: test-bosh
32
32
  ec2_private_key: ~/.microbosh/ssh/test-bosh
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -47,3 +51,6 @@ apply_spec:
47
51
  env:
48
52
  http_proxy: http://192.168.1.100:8080
49
53
  https_proxy: https://192.168.1.100:8080
54
+ ntp:
55
+ - 0.pool.ntp.org
56
+ - 1.pool.ntp.org
@@ -30,6 +30,10 @@ cloud:
30
30
  - bosh-vpc-123456
31
31
  default_key_name: test-bosh
32
32
  ec2_private_key: ~/.microbosh/ssh/test-bosh
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -43,3 +47,6 @@ apply_spec:
43
47
  address: 1.2.3.4
44
48
  dns:
45
49
  recursor: 4.5.6.7
50
+ ntp:
51
+ - 0.pool.ntp.org
52
+ - 1.pool.ntp.org
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: test-bosh
3
+ logging:
4
+ level: DEBUG
5
+ cloud:
6
+ properties:
7
+ agent:
8
+ ntp:
9
+ - 0.foo.pool.ntp.org
10
+ - 1.foo.pool.ntp.org
11
+ apply_spec:
12
+ properties:
13
+ ntp:
14
+ - 0.foo.pool.ntp.org
15
+ - 1.foo.pool.ntp.org
16
+
@@ -2,7 +2,16 @@
2
2
  name: test-bosh
3
3
  logging:
4
4
  level: DEBUG
5
+ cloud:
6
+ properties:
7
+ agent:
8
+ ntp:
9
+ - 0.pool.ntp.org
10
+ - 1.pool.ntp.org
5
11
  apply_spec:
6
12
  properties:
13
+ ntp:
14
+ - 0.pool.ntp.org
15
+ - 1.pool.ntp.org
7
16
  dns:
8
17
  recursor: 4.5.6.7
@@ -2,3 +2,15 @@
2
2
  name: test-bosh
3
3
  logging:
4
4
  level: DEBUG
5
+ cloud:
6
+ properties:
7
+ agent:
8
+ ntp:
9
+ - 0.pool.ntp.org
10
+ - 1.pool.ntp.org
11
+ apply_spec:
12
+ properties:
13
+ ntp:
14
+ - 0.pool.ntp.org
15
+ - 1.pool.ntp.org
16
+
@@ -30,6 +30,10 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: true
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -42,5 +46,5 @@ apply_spec:
42
46
  hm:
43
47
  resurrector_enabled: true
44
48
  ntp:
45
- - 0.north-america.pool.ntp.org
46
- - 1.north-america.pool.ntp.org
49
+ - 0.pool.ntp.org
50
+ - 1.pool.ntp.org
@@ -30,6 +30,10 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -42,5 +46,5 @@ apply_spec:
42
46
  hm:
43
47
  resurrector_enabled: true
44
48
  ntp:
45
- - 0.north-america.pool.ntp.org
46
- - 1.north-america.pool.ntp.org
49
+ - 0.pool.ntp.org
50
+ - 1.pool.ntp.org
@@ -30,6 +30,10 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
@@ -42,5 +46,5 @@ apply_spec:
42
46
  hm:
43
47
  resurrector_enabled: true
44
48
  ntp:
45
- - 0.north-america.pool.ntp.org
46
- - 1.north-america.pool.ntp.org
49
+ - 0.pool.ntp.org
50
+ - 1.pool.ntp.org
@@ -28,6 +28,10 @@ cloud:
28
28
  connection_options:
29
29
  ssl_verify_peer: false
30
30
  boot_from_volume: false
31
+ agent:
32
+ ntp:
33
+ - 0.pool.ntp.org
34
+ - 1.pool.ntp.org
31
35
  apply_spec:
32
36
  agent:
33
37
  blobstore:
@@ -40,5 +44,5 @@ apply_spec:
40
44
  hm:
41
45
  resurrector_enabled: true
42
46
  ntp:
43
- - 0.north-america.pool.ntp.org
44
- - 1.north-america.pool.ntp.org
47
+ - 0.pool.ntp.org
48
+ - 1.pool.ntp.org
@@ -0,0 +1,50 @@
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: 32768
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
+ state_timeout: 300
29
+ private_key: ~/.microbosh/ssh/test-bosh
30
+ connection_options:
31
+ ssl_verify_peer: false
32
+ boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 1.1.2.2
36
+ - 1.1.2.3
37
+ apply_spec:
38
+ agent:
39
+ blobstore:
40
+ address: 10.10.10.3
41
+ nats:
42
+ address: 10.10.10.3
43
+ properties:
44
+ director:
45
+ max_threads: 3
46
+ hm:
47
+ resurrector_enabled: true
48
+ ntp:
49
+ - 1.1.2.2
50
+ - 1.1.2.3
@@ -3,8 +3,8 @@ name: test-bosh
3
3
  logging:
4
4
  level: DEBUG
5
5
  network:
6
- type: dynamic
7
- vip: 1.2.3.4
6
+ type: manual
7
+ ip: 10.10.10.3
8
8
  cloud_properties:
9
9
  net_id: 7b8788eb-b49e-4424-9065-75a6b07094ea
10
10
  resources:
@@ -30,12 +30,16 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
36
- address: 1.2.3.4
40
+ address: 10.10.10.3
37
41
  nats:
38
- address: 1.2.3.4
42
+ address: 10.10.10.3
39
43
  properties:
40
44
  director:
41
45
  max_threads: 3
@@ -45,5 +49,5 @@ apply_spec:
45
49
  hm:
46
50
  resurrector_enabled: true
47
51
  ntp:
48
- - 0.north-america.pool.ntp.org
49
- - 1.north-america.pool.ntp.org
52
+ - 0.pool.ntp.org
53
+ - 1.pool.ntp.org
@@ -3,8 +3,8 @@ name: test-bosh
3
3
  logging:
4
4
  level: DEBUG
5
5
  network:
6
- type: dynamic
7
- vip: 1.2.3.4
6
+ type: manual
7
+ ip: 10.10.10.3
8
8
  cloud_properties:
9
9
  net_id: 7b8788eb-b49e-4424-9065-75a6b07094ea
10
10
  resources:
@@ -30,12 +30,16 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
36
- address: 1.2.3.4
40
+ address: 10.10.10.3
37
41
  nats:
38
- address: 1.2.3.4
42
+ address: 10.10.10.3
39
43
  properties:
40
44
  dns:
41
45
  recursor: 4.5.6.7
@@ -44,5 +48,5 @@ apply_spec:
44
48
  hm:
45
49
  resurrector_enabled: true
46
50
  ntp:
47
- - 0.north-america.pool.ntp.org
48
- - 1.north-america.pool.ntp.org
51
+ - 0.pool.ntp.org
52
+ - 1.pool.ntp.org
@@ -3,8 +3,8 @@ name: test-bosh
3
3
  logging:
4
4
  level: DEBUG
5
5
  network:
6
- type: dynamic
7
- vip: 1.2.3.4
6
+ type: manual
7
+ ip: 10.10.10.3
8
8
  cloud_properties:
9
9
  net_id: 7b8788eb-b49e-4424-9065-75a6b07094ea
10
10
  resources:
@@ -30,17 +30,21 @@ cloud:
30
30
  connection_options:
31
31
  ssl_verify_peer: false
32
32
  boot_from_volume: false
33
+ agent:
34
+ ntp:
35
+ - 0.pool.ntp.org
36
+ - 1.pool.ntp.org
33
37
  apply_spec:
34
38
  agent:
35
39
  blobstore:
36
- address: 1.2.3.4
40
+ address: 10.10.10.3
37
41
  nats:
38
- address: 1.2.3.4
42
+ address: 10.10.10.3
39
43
  properties:
40
44
  director:
41
45
  max_threads: 3
42
46
  hm:
43
47
  resurrector_enabled: true
44
48
  ntp:
45
- - 0.north-america.pool.ntp.org
46
- - 1.north-america.pool.ntp.org
49
+ - 0.pool.ntp.org
50
+ - 1.pool.ntp.org
@@ -38,3 +38,8 @@ cloud:
38
38
  allow_mixed_datastores: true
39
39
  clusters:
40
40
  - CLUSTER01
41
+ apply_spec:
42
+ properties:
43
+ ntp:
44
+ - ntp01.las01.emcatmos.com
45
+ - ntp02.las01.emcatmos.com
@@ -1,4 +1,3 @@
1
-
2
1
  require "readwritesettings"
3
2
  require "bosh-bootstrap/microbosh_providers/base"
4
3
 
@@ -9,7 +8,6 @@ describe Bosh::Bootstrap::MicroboshProviders::Base do
9
8
  let(:fog_compute) { instance_double("Fog::Compute::Base") }
10
9
  subject{ Bosh::Bootstrap::MicroboshProviders::Base.new(microbosh_yml, settings, fog_compute ) }
11
10
 
12
-
13
11
  context "creates micro_bosh.yml manifest" do
14
12
  before { setting "bosh.name", "test-bosh" }
15
13
 
@@ -30,5 +28,28 @@ describe Bosh::Bootstrap::MicroboshProviders::Base do
30
28
  yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.base.without_recursor.yml"))
31
29
  end
32
30
  end
31
+
32
+ describe "#ntp_servers" do
33
+ it "adds ntp when provided as string" do
34
+ setting "ntp", "0.foo.pool.ntp.org,1.foo.pool.ntp.org"
35
+ subject.create_microbosh_yml(settings)
36
+ expect(File).to be_exists(microbosh_yml)
37
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.base.with_ntp.yml"))
38
+ end
39
+
40
+ it "adds ntp when provided as array" do
41
+ setting "ntp", %w[0.foo.pool.ntp.org 1.foo.pool.ntp.org]
42
+ subject.create_microbosh_yml(settings)
43
+ expect(File).to be_exists(microbosh_yml)
44
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.base.with_ntp.yml"))
45
+ end
46
+
47
+ it "adds ntp when setting provided.ntps for backward compatibility" do
48
+ setting "provider.ntps", %w[0.foo.pool.ntp.org 1.foo.pool.ntp.org]
49
+ subject.create_microbosh_yml(settings)
50
+ expect(File).to be_exists(microbosh_yml)
51
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.base.with_ntp.yml"))
52
+ end
53
+ end
33
54
  end
34
55
  end
@@ -4,172 +4,122 @@ require "bosh-bootstrap/microbosh_providers/openstack"
4
4
  describe Bosh::Bootstrap::MicroboshProviders::OpenStack do
5
5
  include Bosh::Bootstrap::Cli::Helpers::Settings
6
6
 
7
- let(:microbosh_yml) { File.expand_path("~/.microbosh/deployments/micro_bosh.yml")}
8
7
  let(:fog_compute) { instance_double("Fog::Compute::OpenStack") }
8
+ let(:microbosh_yml) { File.expand_path("~/.microbosh/deployments/micro_bosh.yml")}
9
9
 
10
- context "creates micro_bosh.yml manifest" do
11
- it "on nova with floating IP" do
12
- setting "provider.name", "openstack"
13
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
14
- setting "provider.credentials.openstack_username", "USER"
15
- setting "provider.credentials.openstack_api_key", "PASSWORD"
16
- setting "provider.credentials.openstack_tenant", "TENANT"
17
- setting "provider.credentials.openstack_region", "REGION"
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", 32768
23
-
24
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
25
-
26
- subject.create_microbosh_yml(settings)
27
- expect(File).to be_exists(microbosh_yml)
28
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.nova_vip.yml"))
10
+ describe "microbosh yml" do
11
+ subject do
12
+ Bosh::Bootstrap::MicroboshProviders::OpenStack
13
+ .new(microbosh_yml, settings, fog_compute)
29
14
  end
30
15
 
31
-
32
-
33
- it "on neutron with public gateway & floating IP" do
16
+ before do
34
17
  setting "provider.name", "openstack"
35
18
  setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
36
19
  setting "provider.credentials.openstack_username", "USER"
37
20
  setting "provider.credentials.openstack_api_key", "PASSWORD"
38
21
  setting "provider.credentials.openstack_tenant", "TENANT"
39
22
  setting "provider.credentials.openstack_region", "REGION"
40
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
41
- setting "address.pool_name", "INTERNET"
42
- setting "address.ip", "1.2.3.4" # network.vip
43
23
  setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
44
24
  setting "bosh.name", "test-bosh"
45
25
  setting "bosh.salted_password", "salted_password"
46
26
  setting "bosh.persistent_disk", 32768
27
+ end
47
28
 
48
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
29
+ context "on nova with floating IP" do
30
+ before do
31
+ setting "address.ip", "1.2.3.4"
32
+ end
33
+
34
+ it "creates micro_bosh.yml manifest" do
35
+ subject.create_microbosh_yml(settings)
36
+ expect(File).to be_exists(microbosh_yml)
37
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.nova_vip.yml"))
38
+ end
49
39
 
50
- subject.create_microbosh_yml(settings)
51
- expect(File).to be_exists(microbosh_yml)
52
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.neutron_vip.yml"))
53
40
  end
54
41
 
55
- it "on neutron with internal static IP only" do
56
- setting "provider.name", "openstack"
57
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
58
- setting "provider.credentials.openstack_username", "USER"
59
- setting "provider.credentials.openstack_api_key", "PASSWORD"
60
- setting "provider.credentials.openstack_tenant", "TENANT"
61
- setting "provider.credentials.openstack_region", "REGION"
62
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
63
- setting "address.ip", "10.10.10.3" # network.ip
64
- setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
65
- setting "bosh.name", "test-bosh"
66
- setting "bosh.salted_password", "salted_password"
67
- setting "bosh.persistent_disk", 32768
42
+ context "on neutron with public gateway & floating IP" do
43
+ before do
44
+ setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
45
+ setting "address.pool_name", "INTERNET"
46
+ setting "address.ip", "1.2.3.4" # network.vip
47
+ end
68
48
 
69
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
49
+ it "creates micro_bosh.yml manifest" do
50
+ subject.create_microbosh_yml(settings)
51
+ expect(File).to be_exists(microbosh_yml)
52
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.neutron_vip.yml"))
53
+ end
70
54
 
71
- subject.create_microbosh_yml(settings)
72
- expect(File).to be_exists(microbosh_yml)
73
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.neutron_manual.yml"))
74
55
  end
56
+ context "on neutron with internal static IP only" do
57
+ before do
58
+ setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
59
+ setting "address.ip", "10.10.10.3" # network.ip
60
+ end
61
+
62
+ it "creates micro_bosh.yml manifest" do
63
+ subject.create_microbosh_yml(settings)
64
+ expect(File).to be_exists(microbosh_yml)
65
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.neutron_manual.yml"))
66
+ end
75
67
 
76
- it "boot from volume" do
77
- setting "provider.name", "openstack"
78
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
79
- setting "provider.credentials.openstack_username", "USER"
80
- setting "provider.credentials.openstack_api_key", "PASSWORD"
81
- setting "provider.credentials.openstack_tenant", "TENANT"
82
- setting "provider.credentials.openstack_region", "REGION"
83
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
84
- setting "address.ip", "10.10.10.3" # network.ip
85
- setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
86
- setting "bosh.name", "test-bosh"
87
- setting "bosh.salted_password", "salted_password"
88
- setting "bosh.persistent_disk", 32768
68
+ end
69
+ context "settings" do
70
+ before do
71
+ setting "address.ip", "10.10.10.3" # network.ip
72
+ setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
73
+ end
89
74
 
90
- setting "provider.options.boot_from_volume", true
75
+ it "boot from volume" do
76
+ setting "provider.options.boot_from_volume", true
91
77
 
92
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
78
+ subject.create_microbosh_yml(settings)
79
+ expect(File).to be_exists(microbosh_yml)
80
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.boot_from_volume.yml"))
81
+ end
93
82
 
94
- subject.create_microbosh_yml(settings)
95
- expect(File).to be_exists(microbosh_yml)
96
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.boot_from_volume.yml"))
97
- end
83
+ it "adds recursor if present" do
84
+ setting "recursor", "4.5.6.7"
98
85
 
99
- it "adds recursor if present" do
100
- setting "provider.name", "openstack"
101
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
102
- setting "provider.credentials.openstack_username", "USER"
103
- setting "provider.credentials.openstack_api_key", "PASSWORD"
104
- setting "provider.credentials.openstack_tenant", "TENANT"
105
- setting "provider.credentials.openstack_region", "REGION"
106
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
107
- setting "address.pool_name", "INTERNET"
108
- setting "address.ip", "1.2.3.4" # network.vip
109
- setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
110
- setting "bosh.name", "test-bosh"
111
- setting "bosh.salted_password", "salted_password"
112
- setting "bosh.persistent_disk", 32768
113
- setting "recursor", "4.5.6.7"
86
+ subject.create_microbosh_yml(settings)
87
+ expect(File).to be_exists(microbosh_yml)
88
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_recursor.yml"))
89
+ end
114
90
 
115
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
91
+ it "adds proxy if present" do
92
+ setting "proxy.http_proxy", "http://192.168.1.100:8080"
93
+ setting "proxy.https_proxy", "https://192.168.1.100:8080"
116
94
 
117
- subject.create_microbosh_yml(settings)
118
- expect(File).to be_exists(microbosh_yml)
119
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_recursor.yml"))
120
- end
95
+ subject.create_microbosh_yml(settings)
96
+ expect(File).to be_exists(microbosh_yml)
97
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_proxy.yml"))
98
+ end
121
99
 
122
- it "adds proxy if present" do
123
- setting "provider.name", "openstack"
124
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
125
- setting "provider.credentials.openstack_username", "USER"
126
- setting "provider.credentials.openstack_api_key", "PASSWORD"
127
- setting "provider.credentials.openstack_tenant", "TENANT"
128
- setting "provider.credentials.openstack_region", "REGION"
129
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
130
- setting "address.pool_name", "INTERNET"
131
- setting "address.ip", "1.2.3.4" # network.vip
132
- setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
133
- setting "bosh.name", "test-bosh"
134
- setting "bosh.salted_password", "salted_password"
135
- setting "bosh.persistent_disk", 32768
136
- setting "proxy.http_proxy", "http://192.168.1.100:8080"
137
- setting "proxy.https_proxy", "https://192.168.1.100:8080"
100
+ it "adds state_timeout if provided" do
101
+ setting "provider.state_timeout", 600
138
102
 
139
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
103
+ subject.create_microbosh_yml(settings)
104
+ expect(File).to be_exists(microbosh_yml)
105
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_state_timeout.yml"))
106
+ end
140
107
 
141
- subject.create_microbosh_yml(settings)
142
- expect(File).to be_exists(microbosh_yml)
143
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_proxy.yml"))
144
- end
108
+ it "uses custom ntp if provided" do
109
+ setting "ntp", %w[1.1.2.2 1.1.2.3]
145
110
 
146
- it "adds state_timeout if provided" do
147
- setting "provider.name", "openstack"
148
- setting "provider.credentials.openstack_auth_url", "http://10.0.0.2:5000/v2.0/tokens"
149
- setting "provider.credentials.openstack_username", "USER"
150
- setting "provider.credentials.openstack_api_key", "PASSWORD"
151
- setting "provider.credentials.openstack_tenant", "TENANT"
152
- setting "provider.credentials.openstack_region", "REGION"
153
- setting "provider.state_timeout", 600
154
- setting "address.subnet_id", "7b8788eb-b49e-4424-9065-75a6b07094ea"
155
- setting "address.pool_name", "INTERNET"
156
- setting "address.ip", "1.2.3.4" # network.vip
157
- setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
158
- setting "bosh.name", "test-bosh"
159
- setting "bosh.salted_password", "salted_password"
160
- setting "bosh.persistent_disk", 32768
161
111
 
162
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
163
- subject.create_microbosh_yml(settings)
164
- expect(File).to be_exists(microbosh_yml)
165
- yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_state_timeout.yml"))
112
+ subject.create_microbosh_yml(settings)
113
+ expect(File).to be_exists(microbosh_yml)
114
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.with_ntp.yml"))
115
+ end
166
116
  end
167
117
  end
168
118
 
169
119
  describe "existing stemcells as openstack images" do
170
-
171
120
  it "finds match" do
172
- subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
121
+ subject = Bosh::Bootstrap::MicroboshProviders::OpenStack
122
+ .new(microbosh_yml, settings, fog_compute)
173
123
  expect(subject).to receive(:owned_images).and_return([
174
124
  instance_double("Fog::Compute::OpenStack::Image",
175
125
  name: "BOSH-14c85f35-3dd3-4200-af85-ada65216b2de",
@@ -178,7 +128,8 @@ describe Bosh::Bootstrap::MicroboshProviders::OpenStack do
178
128
  key: "name", value: "bosh-openstack-kvm-ubuntu-trusty-go_agent"),
179
129
  instance_double("Fog::Compute::OpenStack::Metadata",
180
130
  key: "version", value: "2732"),
181
- ])
131
+ ]
132
+ )
182
133
  ])
183
134
  expect(subject.find_image_for_stemcell("bosh-openstack-kvm-ubuntu-trusty-go_agent", "2732")).to eq("BOSH-14c85f35-3dd3-4200-af85-ada65216b2de")
184
135
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-23 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bosh_cli_plugin_micro
@@ -230,12 +230,14 @@ files:
230
230
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml
231
231
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc_proxy.yml
232
232
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc_recursor.yml
233
+ - spec/assets/microbosh_yml/micro_bosh.base.with_ntp.yml
233
234
  - spec/assets/microbosh_yml/micro_bosh.base.with_recursor.yml
234
235
  - spec/assets/microbosh_yml/micro_bosh.base.without_recursor.yml
235
236
  - spec/assets/microbosh_yml/micro_bosh.openstack.boot_from_volume.yml
236
237
  - spec/assets/microbosh_yml/micro_bosh.openstack.neutron_manual.yml
237
238
  - spec/assets/microbosh_yml/micro_bosh.openstack.neutron_vip.yml
238
239
  - spec/assets/microbosh_yml/micro_bosh.openstack.nova_vip.yml
240
+ - spec/assets/microbosh_yml/micro_bosh.openstack.with_ntp.yml
239
241
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_proxy.yml
240
242
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_recursor.yml
241
243
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_state_timeout.yml
@@ -290,12 +292,14 @@ test_files:
290
292
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml
291
293
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc_proxy.yml
292
294
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc_recursor.yml
295
+ - spec/assets/microbosh_yml/micro_bosh.base.with_ntp.yml
293
296
  - spec/assets/microbosh_yml/micro_bosh.base.with_recursor.yml
294
297
  - spec/assets/microbosh_yml/micro_bosh.base.without_recursor.yml
295
298
  - spec/assets/microbosh_yml/micro_bosh.openstack.boot_from_volume.yml
296
299
  - spec/assets/microbosh_yml/micro_bosh.openstack.neutron_manual.yml
297
300
  - spec/assets/microbosh_yml/micro_bosh.openstack.neutron_vip.yml
298
301
  - spec/assets/microbosh_yml/micro_bosh.openstack.nova_vip.yml
302
+ - spec/assets/microbosh_yml/micro_bosh.openstack.with_ntp.yml
299
303
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_proxy.yml
300
304
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_recursor.yml
301
305
  - spec/assets/microbosh_yml/micro_bosh.openstack.with_state_timeout.yml