kindrobot
kindrobot

Reputation: 1399

Force Vagrant to re-provision or download a new box on next vagrant up

If I change the provision scripts or worse yet, the base OS, is there a way to force vagrant to either re-provision or re-download the base box? I tried to change the config.vm.box and config.vm.box_url, but vagrant up still happily booted up to old box.

I know I could use vagrant destroy and then vagrant up or vagrant provision for just re-provisioning on my own machine, but I'm talking about a way that automatically force my team to re-provision / reinitialize the box (e.g. after they do a git pull and then a vagrant up have it either re-provision or reinitialize appropriately.)

Upvotes: 12

Views: 7153

Answers (1)

mattwise
mattwise

Reputation: 1506

vagrant box --help gives you some options.
Specifically, you can vagrant box remove <name> <provider> to remove a box, and force a re-provisioning.

For example, to remove the Vagrant sample box:

vagrant box remove precise32 virtualbox

Upvotes: 7

Related Questions