tomjn / vagrant-tart-ruby

Tart provider for vagrant using Ruby API
MIT License
16 stars 1 forks source link

Vagrant Tart Ruby Plugin

This is ultra early experimental WIP, not functional yet.

Vagrant Provider Structure

This is a primer on how a vagrant provider works. These are the main parts and what they do:

Box Format

A Tart Vagrant box is a zip/box file containing a vagrantfile and the contents of a tart VM.

Tart VMs

Tart VMs are folders in ~/.tart/vms that take this format where vmname is the name of the VM in Tart:

This is also the format of Tart VMs sent to and pulled from OCI registries.

Vagrant Box Packages

The box is the contents of the VM folder, with a vagrantfile alongside. It's expected that when imported the contents of the box will be extracted into a folder with that name inside ~/.tart/vms.

Identifying Vagrant VMs in Tart

Because it's expected the box contents will become the VM, Vagrant VMs in Tart will have a vagrantfile in their folder. It's also expected their name will have a prefix e.g. vagrant_vm_. This is to aid in identification and to avoid clashes and name collisions with non-vagrant Tart usage.

Installation

Something like this:

bundle install

Usage

Once installed and built you can use bundle exec vagrant to run vagrant with the codebase

Development

See https://developer.hashicorp.com/vagrant/docs/plugins/development-basics#setup-and-workflow

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.