Vagrant Nitrous.IO Provider
This is a Vagrant 1.6+ plugin that adds an Nitrous.IO provider to Vagrant, allowing Vagrant to control and provision containers in Nitrous.IO.
Features
- Create and boot Nitrous.IO containers (boxes) with Vagrant.
- SSH into Nitrous.IO containers.
- Minimal synced folder support via
rsync
. - Provision the boxes with any built-in Vagrant provisioner
Install
Install using standard Vagrant plugin installation methods. After
installing, vagrant up
and specify the nitrousio
provider. An example is
shown below.
$ vagrant plugin install vagrant-nitrousio
Configure
Once the provider has been installed, you will need to configure your project
to use it. A sample Vagrantfile
to create a container on Nitrous.IO
is shown below:
Vagrant.configure("2") do |config|
config.vm.hostname = 'test-box'
config.vm.provider :nitrousio do |provider, override|
override.vm.box = 'nitrousio'
override.vm.box_url = 'https://github.com/nitrous-io/vagrant-nitrousio/raw/master/nitrousio.box'
provider.host = "HOST_SLUG" # copy the host slug from Nitrous.IO web app or CLI
provider.username = ENV['NITROUS_USERNAME']
provider.password = ENV['NITROUS_PASSWORD']
provider.ssh_private_key_path = "~/.ssh/id_rsa"
# remove this to sync your project folder on provision
override.vm.synced_folder '.', '/vagrant', :disabled => true
end
end
Usage
Once you have configured the Vagrantfile, you can create a new container by running:
$ vagrant up --provider=nitrousio
Supported Commands
The provider supports the following Vagrant sub-commands:
vagrant destroy
- Destroys the container.vagrant ssh
- Logs into the container using the default user account.vagrant halt
- Stops the container.vagrant provision
- Runs the configured provisioners and rsyncs any specifiedconfig.vm.synced_folder
.
Configuration
The provider exposes a few provider-specific configuration options:
username
- Username of your Nitrous.IO account.password
- Password of your Nitrous.IO account.host
- Slug of your Nitrous.IO host (you can check this from the web app or CLI)image
- Set a base image for the container. This can be a path to a Docker repository. By default, all vagrant boxes will usenitrousio/vagrant-base
as the image.
Networks
Networking features in the form of config.vm.network
are not
supported with vagrant-nitrousio
, currently. If any of these are
specified, Vagrant will emit a warning, but will otherwise boot
the Nitrous.IO box.
Synced Folders
There is minimal support for synced folders. Upon vagrant up
and vagrant provision
, the Nitrous.IO provider
will use rsync
(if available) to uni-directionally sync the folder
to the remote machine over SSH.
This is good enough for all built-in Vagrant provisioners (shell, chef, and puppet) to work!
License
Copyright (c) 2014 Nitrous, Inc. (formerly Irrational Industries Inc.) and Mitchell Hashimoto This software is licensed under the MIT License.