wrapper script around "vagrant" and "VBoxManage"
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rvmrc
Gemfile
Gemfile.lock
LICENSE.txt
README.mdown

README.mdown

wag

A helper script around the "vagrant" and "VBoxManage" commands.

Vagrant and Oracle's VirtualBox.

Tested with Vagrant 1.0.3.

motivation

I was tired of cding into my guest Vagrantfile's directory. I wanted to simply do

wag myvm ssh

to SSH into it.

I was also playing with special network settings and I got tired of having to type "VBoxManage controlvm myvm_fullanme poweroff" when I needed to shutdown an unreachable guest, so

wag myvm poweroff

is sufficient.

There are other small niceties.

usage

Wag assumes you have a structure like

/Users/jdoe/vagrant
├── work0
│   ├── Vagrantfile
│   └── stuff.txt
├── test
│   └── Vagrantfile
└── test2
    └── Vagrantfile

for your Vagrant virtual machines.

Commands you can run from any work directory:

# to "up" the work0 vm
wag work0 up

# to "up" and immediately ssh into work0
wag work0

# to shut down the test2 vm
wag test2 halt
  # or (as opposed to "up")
wag test2 down

# to power off the vm (hard shutdown, ultima ratio regi)
wag test2 poweroff

# to list the config (Vagrantfile summary) of a vm
wag work0 config
wag work0 network # only the network config

# to print the current vm log
wag work0 log

# to list the vms managed
wag vms

# to list the vms managed and their statuses
wag statuses

# ...

Commands you can run when you're in the same dir as the vm's Vagrant file:

# to "up" the vm
wag up

# to ssh into the machine
wag ssh

# to make sure the vm is up and ssh into it
wag

# ...

advanced commands

TODO

install

curl -L http://git.io/raw > wag
chmod a+x wag
mv wag to/somewhere/in/your/path
wag -v

license

MIT (see LICENSE.txt)