kitchen-vagrant 0.21.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad1eb2e544973ec0e6864be3d857c448edce6be0
4
- data.tar.gz: 80092da59b88a3f00ba1dab7d4160d3bd030c238
3
+ metadata.gz: cdcd8378297c5463119b1d3854aa9e12669b753a
4
+ data.tar.gz: 4775d654b86cb58cf290dbb16dda7cde86522572
5
5
  SHA512:
6
- metadata.gz: e6ea18edbddc33dadcf7ee8be669ab216507364094d6cf04aba8655bff6901449fc7d0217ea351abee4aaa2ca67d4b15a282ab3941daf58e5802f03476287db4
7
- data.tar.gz: fd16e4495a3b1fd544b267ab8f8fa072e6d417801e0109262c3fe12b51b7abd40c749dcacf6595b8021d7b179ee0988265759960a096e72baa5cbd5001a05104
6
+ metadata.gz: 5f2ebcd04539cb4c8df89a484699271e26baf56d5e86a438f89523f73181cd659ab5593dc1b038d5ed913c3287c60f8b7be8b275b4b601eb6312c27f56a0479a
7
+ data.tar.gz: a21647a79c02ec663b974c5be64968ed4d65524fc0d73e6ca6057b71d20d275e21a325bdef4af4d1f0ec72ae79954ef96913653a72287ec6cf8ba72c073a97eb
@@ -1,3 +1,22 @@
1
+ ## [1.0.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.0.0) (2017-01-10)
2
+ [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.21.1...v1.0.0)
3
+
4
+ **Implemented enhancements:**
5
+
6
+ - Add vagrant-cachier support to default Vagrantfile.erb [\#186](https://github.com/test-kitchen/kitchen-vagrant/issues/186)
7
+ - Allow customization of cpuidset for VirtualBox VMs [\#175](https://github.com/test-kitchen/kitchen-vagrant/issues/175)
8
+ - Add KVM/libvirt storage support to Vagrantfile.erb [\#271](https://github.com/test-kitchen/kitchen-vagrant/pull/271) ([dprts](https://github.com/dprts))
9
+ - Move to chefstyle [\#264](https://github.com/test-kitchen/kitchen-vagrant/pull/264) ([shortdudey123](https://github.com/shortdudey123))
10
+ - Allow multiple "include" statements in LXC configuration [\#230](https://github.com/test-kitchen/kitchen-vagrant/pull/230) ([alexmv](https://github.com/alexmv))
11
+ - Set FQDN to include vagrantup.com again for non-windows operating sys… [\#168](https://github.com/test-kitchen/kitchen-vagrant/pull/168) ([spion06](https://github.com/spion06))
12
+ - Virtualbox storage via createhd and storageattach [\#246](https://github.com/test-kitchen/kitchen-vagrant/pull/246) ([shortdudey123](https://github.com/shortdudey123))
13
+ - Add support for box\_download\_ca\_cert [\#274](https://github.com/test-kitchen/kitchen-vagrant/pull/274) ([cheeseplus](https://github.com/cheeseplus))
14
+
15
+ **Fixed bugs:**
16
+
17
+ - Bug in box\_check\_update code [\#237](https://github.com/test-kitchen/kitchen-vagrant/issues/237)
18
+ - Fix quoting for cloud providers \(redux \#179\) [\#268](https://github.com/test-kitchen/kitchen-vagrant/pull/268) ([cheeseplus](https://github.com/cheeseplus))
19
+
1
20
  ## [0.21.1](https://github.com/test-kitchen/kitchen-vagrant/tree/0.21.1) (2016-12-05)
2
21
  [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.21.0...v0.21.1)
3
22
 
data/README.md CHANGED
@@ -33,10 +33,10 @@ If you are creating Windows VMs over a WinRM Transport, then the
33
33
  [vagrant-winrm][vagrant_winrm] Vagrant plugin must be installed. As a
34
34
  consequence, the minimum version of Vagrant required is 1.6 or higher.
35
35
 
36
- ### <a name="dependencies-virtualization"></a> Virtualbox, VMware Fusion/Workstation, and/or Parallels
36
+ ### <a name="dependencies-virtualization"></a> Virtualization Hypervisor(s)
37
37
 
38
- Currently this driver supports VirtualBox and VMware Fusion/Workstation.
39
- Virtualbox is free and is the default provider for Vagrant.
38
+ Currently this driver supports Parallels, VirtualBox, and VMware Fusion/Workstation
39
+ hypervisors. VirtualBox is free and is the default provider for Vagrant.
40
40
 
41
41
  [VirtualBox package][virtualbox_dl]
42
42
 
@@ -70,17 +70,9 @@ on [Atlas][atlas] such as:
70
70
  ```yaml
71
71
  ---
72
72
  platforms:
73
- - name: ubuntu-12.04
74
- - name: ubuntu-14.04
75
- - name: centos-5.11
76
- - name: centos-6.7
77
- - name: centos-7.2
78
- - name: debian-7.9
79
- - name: debian-8.3
80
- - name: fedora-22
81
- - name: fedora-23
82
- - name: freebsd-9.3
83
- - name: freebsd-10.2
73
+ - name: ubuntu-16.04
74
+ - name: centos-7.3
75
+ - name: freebsd-11
84
76
  ```
85
77
 
86
78
  This will effectively generate a configuration similar to:
@@ -88,21 +80,15 @@ This will effectively generate a configuration similar to:
88
80
  ```yaml
89
81
  ---
90
82
  platforms:
91
- - name: ubuntu-12.04
83
+ - name: ubuntu-16.04
92
84
  driver:
93
- box: bento/ubuntu-12.04
94
- - name: ubuntu-14.04
85
+ box: bento/ubuntu-16.04
86
+ - name: centos-7.3
95
87
  driver:
96
- box: bento/ubuntu-14.04
97
- - name: centos-5.11
88
+ box: bento/centos-7.3
89
+ - name: freebsd-11.0
98
90
  driver:
99
- box: bento/centos-5.11
100
- - name: centos-6.7
101
- driver:
102
- box: bento/centos-6.7
103
- - name: centos-7.2
104
- driver:
105
- box: bento/centos-7.2
91
+ box: bento/freebsd-11.0
106
92
  # ...
107
93
  ```
108
94
 
@@ -136,17 +122,41 @@ Many host wide defaults for Vagrant can be set using `$HOME/.vagrant.d/Vagrantfi
136
122
 
137
123
  ## <a name="config"></a> Configuration
138
124
 
125
+ ### <a name="config-cachier"></a> cachier
126
+
127
+ Enable and configure scope for [vagrant-cachier][vagrant_cachier] plugin.
128
+ Valid options are `:box` or `:machine`, setting to a truthy value yields `:box`
129
+
130
+ For example:
131
+
132
+ ```yaml
133
+ ---
134
+ driver:
135
+ cachier: true
136
+ ```
137
+
138
+ will generate a Vagrantfile configuration similar to:
139
+
140
+ ```ruby
141
+ config.cache.scope = :box
142
+ ```
143
+
144
+ The default is `nil`, indicating unset.
145
+
146
+
139
147
  ### <a name="config-box"></a> box
140
148
 
141
149
  **Required** This determines which Vagrant box will be used. For more
142
150
  details, please read the Vagrant [machine settings][vagrant_machine_settings]
143
151
  page.
144
152
 
145
- The default will be computed from the platform name of the instance. However, for a small number of common/known platforms in the [Bento][bento] project, the default will prepend `"opscode-"` to the start to match the downloadable `box_url` (see below).
153
+ The default will be computed from the platform name of the instance. However,
154
+ for a number of common platforms in the [Bento][bento] project, the default will
155
+ prefix the name with `bento/` in accordance with Atlas naming standards.
146
156
 
147
- For example, a platform with a Bento box called "ubuntu-14.04" will produce a
148
- default `box` value of `"opscode-ubuntu-14.04"`. Alternatively, a box called
149
- `"slackware-14.1"` will produce a default `box` value of `"slackware-14.1".
157
+ For example, a platform with name `ubuntu-16.04` will produce a
158
+ default `box` value of `bento/ubuntu-16.04`. Alternatively, a box called
159
+ `slackware-14.1` will produce a default `box` value of `slackware-14.1`.
150
160
 
151
161
  ### <a name="config-box-check-update"></a> box\_check\_update
152
162
 
@@ -154,17 +164,35 @@ Whether to check for box updates (enabled by default).
154
164
 
155
165
  ### <a name="config-box-url"></a> box\_url
156
166
 
157
- A default URL will be computed only for a small number of common/known
158
- platforms in the [Bento][bento] project. Additionally, a URL will only be
159
- computed if the Vagrant provider is VirtualBox or is VMware based (these are
160
- the only providers with downloadable base boxes).
167
+ A box_url is not required when using the Atlas format of
168
+ `bento/ubuntu-16.04` assuming the organization and box referenced
169
+ exist. If using a custom box this can be an `https://` or `file://`
170
+ URL.
171
+
172
+ ### <a name="config-box-download-ca-cert"></a> box\_download\_ca\_cert
173
+
174
+ Path relative to the `.kitchen.yml` file for locating the trusted CA bundle.
175
+ Useful when combined with `box_url`.
176
+
177
+ The default is `nil`, indicating to use the default Mozilla CA cert bundle.
178
+ See also `box_download_insecure`.
179
+
180
+ ### <a name="config-box-download-insecure"></a> box\_download\_insecure
181
+
182
+ If true, then SSL certificates from the server will
183
+ not be verified.
184
+
185
+ The default is `false`, meaning if the URL is an HTTPS URL,
186
+ then SSL certs will be verified.
161
187
 
162
188
  ### <a name="config-box-version"></a> box\_version
163
189
 
164
- The [version][vagrant_versioning] of the configured box.
190
+ The [version][vagrant_versioning] of the configured box.
165
191
 
166
192
  The default is `nil`, indicating unset.
167
193
 
194
+ This option is only relevant when used with Atlas boxes which support versioning.
195
+
168
196
  ### <a name="config-communicator"></a> communicator
169
197
 
170
198
  **Note:** It should largely be the responsibility of the underlying Vagrant
@@ -223,6 +251,42 @@ end
223
251
  Please read the "Customizations" sections for [VirtualBox][vagrant_config_vbox]
224
252
  and [VMware][vagrant_config_vmware] for more details.
225
253
 
254
+ #### <a name="config-customize-virtualbox-disk"></a> VirtualBox additional disk
255
+
256
+ Adding the `createhd` and `storageattach` keys in `customize` allows for creation
257
+ of an additional disk in VirtualBox.
258
+
259
+ ```yaml
260
+ driver:
261
+ customize:
262
+ createhd:
263
+ filename: ./tmp/disk1.vmdk
264
+ size: 1024
265
+ storageattach:
266
+ storagectl: IDE Controller
267
+ port: 1
268
+ device: 0
269
+ type: hdd
270
+ medium: ./tmp/disk1.vmdk
271
+ ```
272
+
273
+ will generate a Vagrantfile configuration similar to:
274
+
275
+ ```ruby
276
+ Vagrant.configure("2") do |config|
277
+ # ...
278
+
279
+ config.vm.provider :virtualbox do |virtualbox|
280
+ virtualbox.customize ["createhd", "--filename", "./tmp/disk1.vmdk", "--size", 1024]
281
+ virtualbox.customize ["storageattach", :id, "--storagectl", "IDE Controller", "--port", "1", "device", 0, "--type", "hdd", "--medium", "./tmp/disk1.vmdk"]
282
+ end
283
+ end
284
+ ```
285
+
286
+ Please read [createhd](https://www.virtualbox.org/manual/ch08.html#vboxmanage-createvdi)
287
+ and [storageattach](https://www.virtualbox.org/manual/ch08.html#vboxmanage-storageattach)
288
+ for additional information on these options.
289
+
226
290
  ### <a name="config-guest"></a> guest
227
291
 
228
292
  **Note:** It should largely be the responsibility of the underlying Vagrant
@@ -245,7 +309,7 @@ providers.
245
309
  ```yaml
246
310
  ---
247
311
  platforms:
248
- - name: ubuntu-14.04
312
+ - name: ubuntu-16.04
249
313
  driver:
250
314
  gui: true
251
315
  ```
@@ -271,7 +335,7 @@ Allows to use linked clones to import boxes for VirtualBox, VMware and Parallels
271
335
  ```yaml
272
336
  ---
273
337
  platforms:
274
- - name: ubuntu-14.04
338
+ - name: ubuntu-16.04
275
339
  driver:
276
340
  linked_clone: true
277
341
  ```
@@ -476,17 +540,17 @@ example:
476
540
 
477
541
  ## <a name="authors"></a> Authors
478
542
 
479
- Created and maintained by [Fletcher Nichol][author] (<fnichol@nichol.ca>)
543
+ Created by [Fletcher Nichol][author] (<fnichol@nichol.ca>)
480
544
 
481
545
  ## <a name="license"></a> License
482
546
 
483
547
  Apache 2.0 (see [LICENSE][license])
484
548
 
485
549
 
486
- [author]: https://github.com/opscode
487
- [issues]: https://github.com/opscode/kitchen-vagrant/issues
488
- [license]: https://github.com/opscode/kitchen-vagrant/blob/master/LICENSE
489
- [repo]: https://github.com/opscode/kitchen-vagrant
550
+ [author]: https://github.com/test-kitchen
551
+ [issues]: https://github.com/test-kitchen/kitchen-vagrant/issues
552
+ [license]: https://github.com/test-kitchen/kitchen-vagrant/blob/master/LICENSE
553
+ [repo]: https://github.com/test-kitchen/kitchen-vagrant
490
554
  [driver_usage]: http://kitchen.ci/docs/getting-started/adding-platform
491
555
 
492
556
  [bento]: https://github.com/chef/bento
@@ -510,3 +574,4 @@ Apache 2.0 (see [LICENSE][license])
510
574
  [atlas]: https://atlas.hashicorp.com/
511
575
  [parallels_dl]: http://www.parallels.com/products/desktop/download/
512
576
  [vagrant_parallels]: https://github.com/Parallels/vagrant-parallels
577
+ [vagrant_cachier]: https://github.com/fgrehm/vagrant-cachier
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ Cane::RakeTask.new do |cane|
17
17
  cane.canefile = "./.cane"
18
18
  end
19
19
 
20
- require "finstyle"
20
+ require "chefstyle"
21
21
  require "rubocop/rake_task"
22
22
  RuboCop::RakeTask.new(:style) do |task|
23
23
  task.options << "--display-cop-names"
@@ -42,5 +42,5 @@ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
42
42
  config.future_release = Kitchen::Driver::VAGRANT_VERSION
43
43
  config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature,Improvement".split(",")
44
44
  config.bug_labels = "bug,Bug".split(",")
45
- config.exclude_labels = %w[Duplicate Question Discussion No_Changelog]
45
+ config.exclude_labels = %w{Duplicate Question Discussion No_Changelog}
46
46
  end
@@ -21,15 +21,12 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.add_dependency "test-kitchen", "~> 1.4"
23
23
 
24
- gem.add_development_dependency "countloc", "~> 0.4"
24
+ gem.add_development_dependency "countloc", "~> 0.4"
25
25
  gem.add_development_dependency "rake"
26
26
  gem.add_development_dependency "rspec", "~> 3.2"
27
27
  gem.add_development_dependency "simplecov", "~> 0.9"
28
28
  gem.add_development_dependency "github_changelog_generator", "1.11.3"
29
29
 
30
- # style and complexity libraries are tightly version pinned as newer releases
31
- # may introduce new and undesireable style choices which would be immediately
32
- # enforced in CI
33
- gem.add_development_dependency "finstyle", "1.5.0"
34
- gem.add_development_dependency "cane", "2.6.2"
30
+ gem.add_development_dependency "chefstyle"
31
+ gem.add_development_dependency "cane", "3.0.0"
35
32
  end
@@ -45,6 +45,8 @@ module Kitchen
45
45
 
46
46
  default_config :box_download_insecure, nil
47
47
 
48
+ default_config :box_download_ca_cert, nil
49
+
48
50
  default_config(:box_url) { |driver| driver.default_box_url }
49
51
 
50
52
  default_config :box_version, nil
@@ -81,13 +83,15 @@ module Kitchen
81
83
  expand_path_for :vagrantfiles
82
84
 
83
85
  default_config(:vm_hostname) do |driver|
84
- driver.windows_os? ? nil : driver.instance.name
86
+ driver.windows_os? ? nil : "#{driver.instance.name}.vagrantup.com"
85
87
  end
86
88
 
87
89
  default_config(:cache_directory) do |driver|
88
90
  driver.windows_os? ? "/omnibus/cache" : "/tmp/omnibus/cache"
89
91
  end
90
92
 
93
+ default_config :cachier, nil
94
+
91
95
  no_parallel_for :create, :destroy
92
96
 
93
97
  # Creates a Vagrant VM instance.
@@ -147,6 +151,7 @@ module Kitchen
147
151
  finalize_vm_hostname!
148
152
  finalize_pre_create_command!
149
153
  finalize_synced_folders!
154
+ finalize_ca_cert!
150
155
  self
151
156
  end
152
157
 
@@ -251,6 +256,15 @@ module Kitchen
251
256
  debug("------------")
252
257
  end
253
258
 
259
+ # Setup path for CA cert
260
+ #
261
+ # @api private
262
+ def finalize_ca_cert!
263
+ config[:box_download_ca_cert] = File.expand_path(
264
+ config[:box_download_ca_cert], config[:kitchen_root]) unless
265
+ config[:box_download_ca_cert].nil?
266
+ end
267
+
254
268
  # Replaces any `{{vagrant_root}}` tokens in the pre create command.
255
269
  #
256
270
  # @api private
@@ -273,7 +287,7 @@ module Kitchen
273
287
  config[:kitchen_root]
274
288
  ),
275
289
  destination.gsub("%{instance_name}", instance.name),
276
- options || "nil"
290
+ options || "nil",
277
291
  ]
278
292
  end
279
293
  add_extra_synced_folders!
@@ -288,7 +302,7 @@ module Kitchen
288
302
  config[:synced_folders].push([
289
303
  local_kitchen_cache,
290
304
  cache_directory,
291
- "create: true"
305
+ "create: true",
292
306
  ])
293
307
  end
294
308
  end
@@ -363,7 +377,7 @@ module Kitchen
363
377
  merged = {
364
378
  :use_sudo => config[:use_sudo],
365
379
  :log_subject => name,
366
- :environment => {}
380
+ :environment => {},
367
381
  }.merge(options)
368
382
 
369
383
  # Attempt to extract bundler and associated GEM related values.
@@ -373,8 +387,8 @@ module Kitchen
373
387
  # "A Hard Problem"(TM), we simply blow away all known bundler
374
388
  # related changes.
375
389
  env = merged[:environment]
376
- %w[BUNDLE_BIN_PATH BUNDLE_GEMFILE GEM_HOME GEM_PATH GEM_ROOT RUBYLIB
377
- RUBYOPT _ORIGINAL_GEM_PATH].each do |var|
390
+ %w{BUNDLE_BIN_PATH BUNDLE_GEMFILE GEM_HOME GEM_PATH GEM_ROOT RUBYLIB
391
+ RUBYOPT _ORIGINAL_GEM_PATH}.each do |var|
378
392
  env[var] = nil
379
393
  end
380
394
 
@@ -456,7 +470,7 @@ module Kitchen
456
470
  # @api private
457
471
  def vagrant_root
458
472
  @vagrant_root ||= instance.nil? ? nil : File.join(
459
- config[:kitchen_root], %w[.kitchen kitchen-vagrant],
473
+ config[:kitchen_root], %w{.kitchen kitchen-vagrant},
460
474
  "kitchen-#{File.basename(config[:kitchen_root])}-#{instance.name}"
461
475
  )
462
476
  end
@@ -470,7 +484,7 @@ module Kitchen
470
484
  lines = run_silently("#{config[:vagrant_binary]} #{type}-config").
471
485
  split("\n").map do |line|
472
486
  tokens = line.strip.partition(" ")
473
- [tokens.first, tokens.last.gsub(/"/, "")]
487
+ [tokens.first, tokens.last.delete('"')]
474
488
  end
475
489
  Hash[lines]
476
490
  end
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Vagrant Kitchen driver
24
- VAGRANT_VERSION = "0.21.1"
24
+ VAGRANT_VERSION = "1.0.0"
25
25
  end
26
26
  end
@@ -122,7 +122,7 @@ describe Kitchen::Driver::Vagrant do
122
122
  "GEM_ROOT" => "gem_root",
123
123
  "RUBYLIB" => "ruby_lib",
124
124
  "RUBYOPT" => "ruby_opt",
125
- "_ORIGINAL_GEM_PATH" => "original_gem_path"
125
+ "_ORIGINAL_GEM_PATH" => "original_gem_path",
126
126
  }
127
127
  end
128
128
 
@@ -153,11 +153,11 @@ describe Kitchen::Driver::Vagrant do
153
153
  [
154
154
  File.expand_path("~/.kitchen/cache"),
155
155
  "/tmp/omnibus/cache",
156
- "create: true"
156
+ "create: true",
157
157
  ]
158
158
  end
159
159
 
160
- %W[centos debian fedora opensuse ubuntu oracle freebsd].each do |name|
160
+ %w{centos debian fedora opensuse ubuntu oracle freebsd}.each do |name|
161
161
 
162
162
  context "for known bento platform names starting with #{name}" do
163
163
 
@@ -210,6 +210,16 @@ describe Kitchen::Driver::Vagrant do
210
210
  expect(driver[:box_check_update]).to eq(true)
211
211
  end
212
212
 
213
+ it "sets :box_download_ca_cert to nil by default" do
214
+ expect(driver[:box_download_ca_cert]).to eq(nil)
215
+ end
216
+
217
+ it "sets :box_download_ca_cert to a custom value" do
218
+ config[:box_download_ca_cert] = "cacert.pem"
219
+
220
+ expect(driver[:box_download_ca_cert]).to eq("/kroot/cacert.pem")
221
+ end
222
+
213
223
  it "sets :box_download_insecure to nil by default" do
214
224
  expect(driver[:box_download_insecure]).to eq(nil)
215
225
  end
@@ -264,11 +274,11 @@ describe Kitchen::Driver::Vagrant do
264
274
 
265
275
  it "sets :network to a custom value" do
266
276
  config[:network] = [
267
- ["forwarded_port", :guest => 80, :host => 8080]
277
+ ["forwarded_port", :guest => 80, :host => 8080],
268
278
  ]
269
279
 
270
280
  expect(driver[:network]).to eq([
271
- ["forwarded_port", :guest => 80, :host => 8080]
281
+ ["forwarded_port", :guest => 80, :host => 8080],
272
282
  ])
273
283
  end
274
284
 
@@ -344,7 +354,7 @@ describe Kitchen::Driver::Vagrant do
344
354
 
345
355
  it "sets :synced_folders to a custom value" do
346
356
  config[:synced_folders] = [
347
- ["/host_path", "/vm_path", "create: true, type: :nfs"]
357
+ ["/host_path", "/vm_path", "create: true, type: :nfs"],
348
358
  ]
349
359
 
350
360
  expect(driver[:synced_folders]).to eq([
@@ -352,40 +362,40 @@ describe Kitchen::Driver::Vagrant do
352
362
  File.expand_path("/host_path"),
353
363
  "/vm_path", "create: true, type: :nfs"
354
364
  ],
355
- cache_directory_array
365
+ cache_directory_array,
356
366
  ])
357
367
  end
358
368
 
359
369
  it "replaces %{instance_name} with instance name in :synced_folders" do
360
370
  config[:synced_folders] = [
361
- ["/root/%{instance_name}", "/vm_path", "stuff"]
371
+ ["/root/%{instance_name}", "/vm_path", "stuff"],
362
372
  ]
363
373
 
364
374
  expect(driver[:synced_folders]).to eq([
365
375
  [File.expand_path("/root/suitey-fooos-99"), "/vm_path", "stuff"],
366
- cache_directory_array
376
+ cache_directory_array,
367
377
  ])
368
378
  end
369
379
 
370
380
  it "expands source paths relative to :kitchen_root in :synced_folders" do
371
381
  config[:synced_folders] = [
372
- ["./a", "/vm_path", "stuff"]
382
+ ["./a", "/vm_path", "stuff"],
373
383
  ]
374
384
 
375
385
  expect(driver[:synced_folders]).to eq([
376
386
  [File.expand_path("/kroot/a"), "/vm_path", "stuff"],
377
- cache_directory_array
387
+ cache_directory_array,
378
388
  ])
379
389
  end
380
390
 
381
391
  it "sets options to 'nil' if not set in :synced_folders entry" do
382
392
  config[:synced_folders] = [
383
- ["/host_path", "/vm_path", nil]
393
+ ["/host_path", "/vm_path", nil],
384
394
  ]
385
395
 
386
396
  expect(driver[:synced_folders]).to eq([
387
397
  [File.expand_path("/host_path"), "/vm_path", "nil"],
388
- cache_directory_array
398
+ cache_directory_array,
389
399
  ])
390
400
  end
391
401
 
@@ -423,10 +433,10 @@ describe Kitchen::Driver::Vagrant do
423
433
  end
424
434
 
425
435
  it "sets and expands paths in :vagrantfiles" do
426
- config[:vagrantfiles] = %W[one two three]
436
+ config[:vagrantfiles] = %w{one two three}
427
437
 
428
438
  expect(driver[:vagrantfiles]).to eq(
429
- %W[/kroot/one /kroot/two /kroot/three].map { |f| File.expand_path(f) }
439
+ %w{/kroot/one /kroot/two /kroot/three}.map { |f| File.expand_path(f) }
430
440
  )
431
441
  end
432
442
 
@@ -435,7 +445,7 @@ describe Kitchen::Driver::Vagrant do
435
445
  before { allow(platform).to receive(:os_type).and_return("unix") }
436
446
 
437
447
  it "sets :vm_hostname to the instance name by default" do
438
- expect(driver[:vm_hostname]).to eq("suitey-fooos-99")
448
+ expect(driver[:vm_hostname]).to eq("suitey-fooos-99.vagrantup.com")
439
449
  end
440
450
 
441
451
  it "sets :vm_hostname to a custom value" do
@@ -451,7 +461,7 @@ describe Kitchen::Driver::Vagrant do
451
461
  [
452
462
  File.expand_path("~/.kitchen/cache"),
453
463
  "/omnibus/cache",
454
- "create: true"
464
+ "create: true",
455
465
  ]
456
466
  end
457
467
 
@@ -473,12 +483,12 @@ describe Kitchen::Driver::Vagrant do
473
483
 
474
484
  it "replaces %{instance_name} with instance name in :synced_folders" do
475
485
  config[:synced_folders] = [
476
- ["/root/%{instance_name}", "/vm_path", "stuff"]
486
+ ["/root/%{instance_name}", "/vm_path", "stuff"],
477
487
  ]
478
488
 
479
489
  expect(driver[:synced_folders]).to eq([
480
490
  [File.expand_path("/root/suitey-fooos-99"), "/vm_path", "stuff"],
481
- win_cache_directory_array
491
+ win_cache_directory_array,
482
492
  ])
483
493
  end
484
494
  end
@@ -489,7 +499,7 @@ describe Kitchen::Driver::Vagrant do
489
499
  [
490
500
  File.expand_path("~/.kitchen/cache"),
491
501
  "Z:\\awesome\\cache",
492
- "create: true"
502
+ "create: true",
493
503
  ]
494
504
  end
495
505
 
@@ -501,12 +511,12 @@ describe Kitchen::Driver::Vagrant do
501
511
 
502
512
  it "replaces %{instance_name} with instance name in :synced_folders" do
503
513
  config[:synced_folders] = [
504
- ["/root/%{instance_name}", "/vm_path", "stuff"]
514
+ ["/root/%{instance_name}", "/vm_path", "stuff"],
505
515
  ]
506
516
 
507
517
  expect(driver[:synced_folders]).to eq([
508
518
  [File.expand_path("/root/suitey-fooos-99"), "/vm_path", "stuff"],
509
- custom_cache_directory_array
519
+ custom_cache_directory_array,
510
520
  ])
511
521
  end
512
522
  end
@@ -606,10 +616,10 @@ describe Kitchen::Driver::Vagrant do
606
616
  let(:cmd) { driver.create(state) }
607
617
 
608
618
  let(:vagrant_root) do
609
- File.join(%W[
619
+ File.join(%W{
610
620
  #{@dir} .kitchen kitchen-vagrant
611
621
  kitchen-#{File.basename(@dir)}-suitey-fooos-99
612
- ])
622
+ })
613
623
  end
614
624
 
615
625
  before do
@@ -838,10 +848,10 @@ describe Kitchen::Driver::Vagrant do
838
848
  let(:cmd) { driver.destroy(state) }
839
849
 
840
850
  let(:vagrant_root) do
841
- File.join(%W[
851
+ File.join(%W{
842
852
  #{@dir} .kitchen kitchen-vagrant
843
853
  kitchen-#{File.basename(@dir)}-suitey-fooos-99
844
- ])
854
+ })
845
855
  end
846
856
 
847
857
  before do
@@ -928,10 +938,10 @@ describe Kitchen::Driver::Vagrant do
928
938
  let(:cmd) { driver.create(state) }
929
939
 
930
940
  let(:vagrant_root) do
931
- File.join(%W[
941
+ File.join(%W{
932
942
  #{@dir} .kitchen kitchen-vagrant
933
943
  kitchen-#{File.basename(@dir)}-suitey-fooos-99
934
- ])
944
+ })
935
945
  end
936
946
 
937
947
  before do
@@ -955,6 +965,27 @@ describe Kitchen::Driver::Vagrant do
955
965
  ))
956
966
  end
957
967
 
968
+ it "sets no cache.scope if missing" do
969
+ config[:cachier] = nil
970
+ cmd
971
+
972
+ expect(vagrantfile).to_not match(regexify(%{c.cache.scope}, :partial))
973
+ end
974
+
975
+ it "sets cache.scope to :box if :cachier is set" do
976
+ config[:cachier] = true
977
+ cmd
978
+
979
+ expect(vagrantfile).to match(regexify(%{c.cache.scope = :box}))
980
+ end
981
+
982
+ it "sets cache.scope if :cachier is set to a custom value" do
983
+ config[:cachier] = ":machine"
984
+ cmd
985
+
986
+ expect(vagrantfile).to match(regexify(%{c.cache.scope = :machine}))
987
+ end
988
+
958
989
  it "sets the vm.box" do
959
990
  cmd
960
991
 
@@ -993,7 +1024,7 @@ describe Kitchen::Driver::Vagrant do
993
1024
  end
994
1025
 
995
1026
  it "requires each entry in :vagranfiles" do
996
- config[:vagrantfiles] = %W[/a /b /c]
1027
+ config[:vagrantfiles] = %w{/a /b /c}
997
1028
  cmd
998
1029
 
999
1030
  expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
@@ -1060,14 +1091,7 @@ describe Kitchen::Driver::Vagrant do
1060
1091
  config[:box_check_update] = false
1061
1092
  cmd
1062
1093
 
1063
- expect(vagrantfile).to match(regexify(%{c.vm.box_check_update = "false"}))
1064
- end
1065
-
1066
- it "sets vm.box_check_update if :box_check_update is set" do
1067
- config[:box_check_update] = "um"
1068
- cmd
1069
-
1070
- expect(vagrantfile).to match(regexify(%{c.vm.box_check_update = "um"}))
1094
+ expect(vagrantfile).to match(regexify(%{c.vm.box_check_update = false}))
1071
1095
  end
1072
1096
 
1073
1097
  it "sets no vm.box_download_insecure if missing" do
@@ -1192,7 +1216,7 @@ describe Kitchen::Driver::Vagrant do
1192
1216
  :username => %{jdoe},
1193
1217
  :password => %{secret},
1194
1218
  :private_key_path => %{/key},
1195
- :insert_key => false
1219
+ :insert_key => false,
1196
1220
  }
1197
1221
  cmd
1198
1222
 
@@ -1207,7 +1231,7 @@ describe Kitchen::Driver::Vagrant do
1207
1231
  it "adds a vm.network line for each element in :network" do
1208
1232
  config[:network] = [
1209
1233
  ["forwarded_port", { :guest => 80, :host => 8080 }],
1210
- ["private_network", { :ip => "192.168.33.33" }]
1234
+ ["private_network", { :ip => "192.168.33.33" }],
1211
1235
  ]
1212
1236
  cmd
1213
1237
 
@@ -1220,7 +1244,7 @@ describe Kitchen::Driver::Vagrant do
1220
1244
  it "adds a vm.synced_folder line for each element in :synced_folders" do
1221
1245
  config[:synced_folders] = [
1222
1246
  ["/a/b", "/opt/instance_data", "nil"],
1223
- ["/host_path", "/vm_path", "create: true, type: :nfs"]
1247
+ ["/host_path", "/vm_path", "create: true, type: :nfs"],
1224
1248
  ]
1225
1249
  cmd
1226
1250
 
@@ -1233,7 +1257,7 @@ describe Kitchen::Driver::Vagrant do
1233
1257
  it "vm.synced_folder scapes the back slashes for Windows paths" do
1234
1258
  config[:synced_folders] = [
1235
1259
  ["/a/b", "C:\\opt\\instance_data", "nil"],
1236
- ["Z:\\host_path", "/vm_path", "create: true"]
1260
+ ["Z:\\host_path", "/vm_path", "create: true"],
1237
1261
  ]
1238
1262
  cmd
1239
1263
 
@@ -1250,7 +1274,7 @@ describe Kitchen::Driver::Vagrant do
1250
1274
  it "adds a line for each element in :customize" do
1251
1275
  config[:customize] = {
1252
1276
  :a_key => "some value",
1253
- :something => "else"
1277
+ :something => "else",
1254
1278
  }
1255
1279
  cmd
1256
1280
 
@@ -1320,6 +1344,51 @@ describe Kitchen::Driver::Vagrant do
1320
1344
  end
1321
1345
  RUBY
1322
1346
  end
1347
+
1348
+ it "adds a lines for createhd in :customize" do
1349
+ config[:customize] = {
1350
+ :createhd => {
1351
+ :filename => "./d1.vmdk",
1352
+ :size => 10 * 1024,
1353
+ },
1354
+ }
1355
+ cmd
1356
+
1357
+ expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
1358
+ c.vm.provider :virtualbox do |p|
1359
+ p.customize ["createhd", "--filename", "./d1.vmdk", "--size", 10240]
1360
+ end
1361
+ RUBY
1362
+ end
1363
+
1364
+ it "adds a lines for storageattach in :customize" do
1365
+ config[:customize] = {
1366
+ :storageattach => {
1367
+ :type => "hdd",
1368
+ :port => 1,
1369
+ },
1370
+ }
1371
+ cmd
1372
+
1373
+ expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
1374
+ c.vm.provider :virtualbox do |p|
1375
+ p.customize ["storageattach", :id, "--type", "hdd", "--port", 1]
1376
+ end
1377
+ RUBY
1378
+ end
1379
+
1380
+ it "adds a line for cpuidset in :customize" do
1381
+ config[:customize] = {
1382
+ :cpuidset => %w{00000001 00000002},
1383
+ }
1384
+ cmd
1385
+
1386
+ expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
1387
+ c.vm.provider :virtualbox do |p|
1388
+ p.customize ["modifyvm", :id, "--cpuidset", "00000001", "00000002"]
1389
+ end
1390
+ RUBY
1391
+ end
1323
1392
  end
1324
1393
 
1325
1394
  context "for parallels provider" do
@@ -1329,7 +1398,7 @@ describe Kitchen::Driver::Vagrant do
1329
1398
  it "adds a line for each element in :customize" do
1330
1399
  config[:customize] = {
1331
1400
  :a_key => "some value",
1332
- :something => "else"
1401
+ :something => "else",
1333
1402
  }
1334
1403
  cmd
1335
1404
 
@@ -1344,7 +1413,7 @@ describe Kitchen::Driver::Vagrant do
1344
1413
  it "adds a short form of :memory and :cpus elements in :customize" do
1345
1414
  config[:customize] = {
1346
1415
  :memory => 2048,
1347
- :cpus => 4
1416
+ :cpus => 4,
1348
1417
  }
1349
1418
  cmd
1350
1419
 
@@ -1394,7 +1463,7 @@ describe Kitchen::Driver::Vagrant do
1394
1463
  it "adds a line for each element in :customize" do
1395
1464
  config[:customize] = {
1396
1465
  :a_key => "some value",
1397
- :something => "else"
1466
+ :something => "else",
1398
1467
  }
1399
1468
  cmd
1400
1469
 
@@ -1415,8 +1484,8 @@ describe Kitchen::Driver::Vagrant do
1415
1484
  config[:customize] = {
1416
1485
  :disk_capacity => {
1417
1486
  :"0" => 25,
1418
- :"2" => 100
1419
- }
1487
+ :"2" => 100,
1488
+ },
1420
1489
  }
1421
1490
  cmd
1422
1491
 
@@ -1430,7 +1499,7 @@ describe Kitchen::Driver::Vagrant do
1430
1499
  it "adds a line for each element in :customize" do
1431
1500
  config[:customize] = {
1432
1501
  :a_key => "some value",
1433
- :something => "else"
1502
+ :something => "else",
1434
1503
  }
1435
1504
  cmd
1436
1505
 
@@ -1451,7 +1520,7 @@ describe Kitchen::Driver::Vagrant do
1451
1520
  config[:customize] = {
1452
1521
  :a_key => "some value",
1453
1522
  :something => "else",
1454
- :a_number_key => 1024
1523
+ :a_number_key => 1024,
1455
1524
  }
1456
1525
  cmd
1457
1526
 
@@ -1463,6 +1532,38 @@ describe Kitchen::Driver::Vagrant do
1463
1532
  end
1464
1533
  RUBY
1465
1534
  end
1535
+
1536
+ it "adds a single storage definition in :customize" do
1537
+ config[:customize] = {
1538
+ :storage => ":file, :size => '32G'",
1539
+ }
1540
+ cmd
1541
+
1542
+ expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
1543
+ c.vm.provider :libvirt do |p|
1544
+ p.storage :file, :size => '32G'
1545
+ end
1546
+ RUBY
1547
+ end
1548
+
1549
+ it "adds a line for each additional storage definition in :customize" do
1550
+ config[:customize] = {
1551
+ :storage => [
1552
+ ":file, :size => '1G'",
1553
+ ":file, :size => '128G', :bus => 'sata'",
1554
+ ":file, :size => '64G', :bus => 'sata'",
1555
+ ],
1556
+ }
1557
+ cmd
1558
+
1559
+ expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
1560
+ c.vm.provider :libvirt do |p|
1561
+ p.storage :file, :size => '1G'
1562
+ p.storage :file, :size => '128G', :bus => 'sata'
1563
+ p.storage :file, :size => '64G', :bus => 'sata'
1564
+ end
1565
+ RUBY
1566
+ end
1466
1567
  end
1467
1568
 
1468
1569
  context "for lxc provider" do
@@ -1471,7 +1572,7 @@ describe Kitchen::Driver::Vagrant do
1471
1572
 
1472
1573
  it "sets container_name to :machine if set" do
1473
1574
  config[:customize] = {
1474
- :container_name => ":machine"
1575
+ :container_name => ":machine",
1475
1576
  }
1476
1577
  cmd
1477
1578
 
@@ -1484,7 +1585,7 @@ describe Kitchen::Driver::Vagrant do
1484
1585
 
1485
1586
  it "sets container_name to another value in quotes if set" do
1486
1587
  config[:customize] = {
1487
- :container_name => "beans"
1588
+ :container_name => "beans",
1488
1589
  }
1489
1590
  cmd
1490
1591
 
@@ -1497,7 +1598,7 @@ describe Kitchen::Driver::Vagrant do
1497
1598
 
1498
1599
  it "sets backingstore if set" do
1499
1600
  config[:customize] = {
1500
- :backingstore => "lvm"
1601
+ :backingstore => "lvm",
1501
1602
  }
1502
1603
  cmd
1503
1604
 
@@ -1512,8 +1613,8 @@ describe Kitchen::Driver::Vagrant do
1512
1613
  config[:customize] = {
1513
1614
  :backingstore_options => {
1514
1615
  :vgname => "schroots",
1515
- :fstype => "xfs"
1516
- }
1616
+ :fstype => "xfs",
1617
+ },
1517
1618
  }
1518
1619
  cmd
1519
1620
 
@@ -1528,7 +1629,7 @@ describe Kitchen::Driver::Vagrant do
1528
1629
  it "sets all other options to customize lines" do
1529
1630
  config[:customize] = {
1530
1631
  :cookies => "cream",
1531
- :salt => "vinegar"
1632
+ :salt => "vinegar",
1532
1633
  }
1533
1634
  cmd
1534
1635
 
@@ -1577,7 +1678,7 @@ describe Kitchen::Driver::Vagrant do
1577
1678
  it "adds a line for each element in :customize" do
1578
1679
  config[:customize] = {
1579
1680
  :a_key => "some value",
1580
- :something => "else"
1681
+ :something => "else",
1581
1682
  }
1582
1683
  cmd
1583
1684
 
@@ -1591,7 +1692,7 @@ describe Kitchen::Driver::Vagrant do
1591
1692
 
1592
1693
  it "converts :memory into :memsize" do
1593
1694
  config[:customize] = {
1594
- :memory => "222"
1695
+ :memory => "222",
1595
1696
  }
1596
1697
  cmd
1597
1698
 
@@ -1605,7 +1706,7 @@ describe Kitchen::Driver::Vagrant do
1605
1706
  it "skips :memory if key :memsize exists" do
1606
1707
  config[:customize] = {
1607
1708
  :memory => "222",
1608
- :memsize => "444"
1709
+ :memsize => "444",
1609
1710
  }
1610
1711
  cmd
1611
1712
 
@@ -1618,7 +1719,7 @@ describe Kitchen::Driver::Vagrant do
1618
1719
 
1619
1720
  it "converts :cpus into :numvcpus" do
1620
1721
  config[:customize] = {
1621
- :cpus => "2"
1722
+ :cpus => "2",
1622
1723
  }
1623
1724
  cmd
1624
1725
 
@@ -1632,7 +1733,7 @@ describe Kitchen::Driver::Vagrant do
1632
1733
  it "skips :cpus if key :numvcpus exists" do
1633
1734
  config[:customize] = {
1634
1735
  :cpus => "2",
1635
- :numvcpus => "4"
1736
+ :numvcpus => "4",
1636
1737
  }
1637
1738
  cmd
1638
1739
 
@@ -1650,7 +1751,7 @@ describe Kitchen::Driver::Vagrant do
1650
1751
 
1651
1752
  it "adds a line a server" do
1652
1753
  config[:customize] = {
1653
- :server => "my_server"
1754
+ :server => "my_server",
1654
1755
  }
1655
1756
  cmd
1656
1757
 
@@ -1664,7 +1765,7 @@ describe Kitchen::Driver::Vagrant do
1664
1765
  it "ignores all other key types than server" do
1665
1766
  config[:customize] = {
1666
1767
  :other => "stuff",
1667
- :is => "ignored"
1768
+ :is => "ignored",
1668
1769
  }
1669
1770
  cmd
1670
1771
 
@@ -1683,7 +1784,7 @@ describe Kitchen::Driver::Vagrant do
1683
1784
  config[:customize] = {
1684
1785
  :key1 => "some string value",
1685
1786
  :key2 => 22,
1686
- :key3 => false
1787
+ :key3 => false,
1687
1788
  }
1688
1789
  cmd
1689
1790
 
@@ -1704,7 +1805,7 @@ describe Kitchen::Driver::Vagrant do
1704
1805
  it "adds a line for each element in :customize" do
1705
1806
  config[:customize] = {
1706
1807
  :a_key => "some value",
1707
- :something => "else"
1808
+ :something => "else",
1708
1809
  }
1709
1810
  cmd
1710
1811
 
@@ -1724,16 +1825,16 @@ describe Kitchen::Driver::Vagrant do
1724
1825
  :cidrlist => "B.B.B.B/24",
1725
1826
  :protocol => "tcp",
1726
1827
  :startport => 2222,
1727
- :endport => 2222
1828
+ :endport => 2222,
1728
1829
  },
1729
1830
  {
1730
1831
  :ipaddress => "C.C.C.C",
1731
1832
  :cidrlist => "D.D.D.D/32",
1732
1833
  :protocol => "tcp",
1733
1834
  :startport => 80,
1734
- :endport => 81
1735
- }
1736
- ]
1835
+ :endport => 81,
1836
+ },
1837
+ ],
1737
1838
  }
1738
1839
  cmd
1739
1840
 
@@ -1752,7 +1853,7 @@ describe Kitchen::Driver::Vagrant do
1752
1853
  it "builds an array for security group ids in :customize" do
1753
1854
  config[:customize] = {
1754
1855
  :security_group_ids => ["aaaa-bbbb-cccc-dddd",
1755
- "1111-2222-3333-4444"]
1856
+ "1111-2222-3333-4444"],
1756
1857
  }
1757
1858
  cmd
1758
1859
 
@@ -1768,8 +1869,8 @@ describe Kitchen::Driver::Vagrant do
1768
1869
 
1769
1870
  it "builds an array for security group names in :customize" do
1770
1871
  config[:customize] = {
1771
- :security_group_names => %w[min_fantastiska_security_group
1772
- another_security_group]
1872
+ :security_group_names => %w{min_fantastiska_security_group
1873
+ another_security_group},
1773
1874
  }
1774
1875
  cmd
1775
1876
 
@@ -1795,18 +1896,18 @@ describe Kitchen::Driver::Vagrant do
1795
1896
  :protocol => "TCP",
1796
1897
  :startport => 22,
1797
1898
  :endport => 22,
1798
- :cidrlist => "0.0.0.0/0"
1899
+ :cidrlist => "0.0.0.0/0",
1799
1900
  },
1800
1901
  {
1801
1902
  :type => "egress",
1802
1903
  :protocol => "TCP",
1803
1904
  :startport => 81,
1804
1905
  :endport => 82,
1805
- :cidrlist => "1.2.3.4/24"
1806
- }
1807
- ]
1808
- }
1809
- ]
1906
+ :cidrlist => "1.2.3.4/24",
1907
+ },
1908
+ ],
1909
+ },
1910
+ ],
1810
1911
  }
1811
1912
  cmd
1812
1913
 
@@ -1826,7 +1927,7 @@ describe Kitchen::Driver::Vagrant do
1826
1927
 
1827
1928
  it "builds an array of hashes for static nat in :customize" do
1828
1929
  config[:customize] = {
1829
- :static_nat => [{ :idaddress => "A.A.A.A" }]
1930
+ :static_nat => [{ :idaddress => "A.A.A.A" }],
1830
1931
  }
1831
1932
  cmd
1832
1933
 
@@ -1845,16 +1946,16 @@ describe Kitchen::Driver::Vagrant do
1845
1946
  :protocol => "tcp",
1846
1947
  :publicport => 22,
1847
1948
  :privateport => 22,
1848
- :openfirewall => false
1949
+ :openfirewall => false,
1849
1950
  },
1850
1951
  {
1851
1952
  :ipaddress => "X.X.X.X",
1852
1953
  :protocol => "tcp",
1853
1954
  :publicport => 80,
1854
1955
  :privateport => 80,
1855
- :openfirewall => false
1856
- }
1857
- ]
1956
+ :openfirewall => false,
1957
+ },
1958
+ ],
1858
1959
  }
1859
1960
  cmd
1860
1961
 
@@ -4,6 +4,12 @@ require "<%= vagrantfile %>"
4
4
 
5
5
  Vagrant.configure("2") do |c|
6
6
  c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
7
+ <% if config[:cachier] %>
8
+ if Vagrant.has_plugin?("vagrant-cachier")
9
+ c.cache.scope = <%= [':box', ':machine'].include?(config[:cachier]) ? config[:cachier] : ':box' %>
10
+ end
11
+ <% end %>
12
+
7
13
  c.vm.box = "<%= config[:box] %>"
8
14
 
9
15
  <% if config[:box_url] %>
@@ -15,7 +21,11 @@ Vagrant.configure("2") do |c|
15
21
  <% end %>
16
22
 
17
23
  <% if !config[:box_check_update].nil? %>
18
- c.vm.box_check_update = "<%= config[:box_check_update] %>"
24
+ c.vm.box_check_update = <%= config[:box_check_update] %>
25
+ <% end %>
26
+
27
+ <% if !config[:box_download_ca_cert].nil? %>
28
+ c.vm.box_download_ca_cert = "<%= config[:box_download_ca_cert] %>"
19
29
  <% end %>
20
30
 
21
31
  <% if !config[:box_download_insecure].nil? %>
@@ -93,11 +103,21 @@ Vagrant.configure("2") do |c|
93
103
  <% config[:customize].each do |key, value| %>
94
104
  <% case config[:provider]
95
105
  when "libvirt" %>
96
- <% if value.is_a? String %>
106
+ <% if key == :storage %>
107
+ <% if value.is_a? String %>
108
+ p.storage <%= value %>
109
+ <% elsif value.is_a? Array %>
110
+ <% value.each do |v| %>
111
+ p.storage <%= v %>
112
+ <% end %>
113
+ <% end %>
114
+ <% else %>
115
+ <% if value.is_a? String %>
97
116
  p.<%= key %> = "<%= value%>"
98
- <% else %>
117
+ <% else %>
99
118
  p.<%= key %> = <%= value%>
100
- <% end %>
119
+ <% end %>
120
+ <% end %>
101
121
  <% when "lxc" %>
102
122
  <% if key == :container_name %>
103
123
  p.container_name = <%= value == ":machine" ? value : "\"#{value}\"" %>
@@ -107,6 +127,10 @@ Vagrant.configure("2") do |c|
107
127
  <% config[:customize][:backingstore_options].each do |opt, opt_val| %>
108
128
  p.backingstore_option "--<%= opt %>", "<%= opt_val %>"
109
129
  <% end %>
130
+ <% elsif key == :include %>
131
+ <% Array(value).each do |include| %>
132
+ p.customize "<%= key %>", "<%= include %>"
133
+ <% end %>
110
134
  <% else %>
111
135
  p.customize "<%= key %>", "<%= value %>"
112
136
  <% end %>
@@ -120,8 +144,6 @@ Vagrant.configure("2") do |c|
120
144
  <% else %>
121
145
  p.customize ["set", :id, "--<%= key.to_s.gsub('_', '-') %>", "<%= value %>"]
122
146
  <% end %>
123
- <% when "rackspace" %>
124
- p.<%= key %> = "<%= value%>"
125
147
  <% when "softlayer" %>
126
148
  <% if key == :disk_capacity %>
127
149
  p.<%= key %> = <%= value %>
@@ -129,7 +151,28 @@ Vagrant.configure("2") do |c|
129
151
  p.<%= key %> = "<%= value %>"
130
152
  <% end %>
131
153
  <% when "virtualbox" %>
154
+ <% if key == :createhd %>
155
+ p.customize ["createhd", "--filename", "<%= value[:filename] %>", "--size", <%= value[:size] %>]
156
+ <% elsif key == :storageattach %>
157
+ <% options = [] %>
158
+ <% value.each do |storageattach_option_key, storageattach_option_value|
159
+ options << "\"--#{storageattach_option_key}\""
160
+ if storageattach_option_value.instance_of? Fixnum
161
+ options << storageattach_option_value
162
+ else
163
+ options << "\"#{storageattach_option_value}\""
164
+ end
165
+ end %>
166
+ p.customize ["storageattach", :id, <%= options.join(', ') %>]
167
+ <% elsif key == :cpuidset %>
168
+ <% ids = [] %>
169
+ <% value.each do | id |
170
+ ids << "\"#{id}\""
171
+ end %>
172
+ p.customize ["modifyvm", :id, "--cpuidset", <%= ids.join(', ') %>]
173
+ <% else %>
132
174
  p.customize ["modifyvm", :id, "--<%= key %>", "<%= value %>"]
175
+ <% end %>
133
176
  <% when /^vmware_/ %>
134
177
  <% if key == :memory %>
135
178
  <% unless config[:customize].include?(:memsize) %>
@@ -142,7 +185,7 @@ Vagrant.configure("2") do |c|
142
185
  <% else %>
143
186
  p.vmx["<%= key %>"] = "<%= value %>"
144
187
  <% end %>
145
- <% when "openstack", "cloudstack", "hyperv", "ovirt3" %>
188
+ <% when "openstack", "cloudstack", "hyperv", "ovirt3", "rackspace", "aws" %>
146
189
  <% if value.is_a? String %>
147
190
  p.<%= key %> = "<%= value%>"
148
191
  <% else %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2017-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -95,33 +95,33 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.11.3
97
97
  - !ruby/object:Gem::Dependency
98
- name: finstyle
98
+ name: chefstyle
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.5.0
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 1.5.0
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: cane
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 2.6.2
117
+ version: 3.0.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 2.6.2
124
+ version: 3.0.0
125
125
  description: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
126
126
  email:
127
127
  - fnichol@nichol.ca
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.6.7
167
+ rubygems_version: 2.5.1
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.