Notes on how to set up and use the hooks to create additional ephemeral disks in kitchen-vagrant/virtualbox runs with test-kitchen.
- .kitchen.yml
- scripts/write_vagrantfiles.rb
- Berksfile
- Rakefile
- Gemfile (Requires a minimum kitchen-vagrant version of 0.16.0)
- .gitignore
- ruby 2+ - kitchen-vagrant 0.16.0 is currently broken for older rubygems versions
- Enough local disk space to create your desired virtual disk
- Update your Gemfile to use kitchen-vagrant, version 0.16.0 or greater. At this time, it's still beta and not yet packaged in gem, so you'll need to pull from github.com.
- You'll need a recipe to format and mount the additional disk. Add this
to the
.kitche.ymlat the beginning of therun_listfor the suites that need it. - In the
Rakefile, the:cleanupnamespace and theintegration:pre_cmdstask are added to manage the setup and tear-down for the additional disk. - You'll want to add the following to the cookbook .gitignore:
.kitchen.local.yml
Vagrantfiles/
vagrant_disks/
- The setup script looks for the attribute
add_vagrant_disk: truein the.kitchen.ymlsuites that need an additional disk. - By default, the added disk will be 10Gb. For a different size, you can
add the attribute
vagrant_disk_sizeto the suite (value should be an integer, in Gb).
bundle installbundle exec berks installbundle exec rake setupbundle exec kitchen converge [target instance]- Test your stuff
- When you're ready to clean up, run
bundle exec rake cleanup
- If you need to update your
.kitchen.yml, you will need to re-runbundle exec rake setupeach time, as the setup writes a.kitchen.local.ymlbased on the.kitchen.ymlfile.