Destroying all your Vagrant Boxes

Destroying all your Vagrant Boxes

TLDR; for vb in `vagrant global-status | grep virtualbox | awk '{ print $1 }'` ; do vagrant destroy $vb ; done I've been playing around with Vagrant a lot recently and in doing so I've ended up with lots of unused vagrant boxes on my machine. I could go and delete them all individually but it seemed a good oppertunity to learn some scripting. Stage One - Finding all the Vagrant Boxes Vagrant has a command that allows you to list all the vagrant machines currently on your computer, vagrant global-status: $ vagrant global-status id name provider state directory ------------------------------------------------------------------------------- 1e4d043 acs virtualbox running…

Read More

Learning Ops Tooling, Part One - Vagrant

Learning Ops Tooling, Part One - Vagrant

Learning Ops Tooling, Part One - Vagrant Learning Ops Tooling, Part Two - Starting with Ansible Learning Ops Tooling, Part Three - More Ansible Learning Ops Tooling, Part Four - Pulling and running the blog I've been wanting to explore the world of "infrastructure as code", or IaC, for a while now but for one reason or another I just haven't had time (probably due to having a child to look after). Not wanting to let this go on any longer I've decided I need to make time to look into what tools are available and how to…

Read More