12

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.)

kindrobot
  • 1,309
  • 1
  • 10
  • 19

1 Answers1

7

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
mattwise
  • 1,464
  • 1
  • 10
  • 20
  • 2
    Minor note for people coming to this answer later - the second argument is set to be removed, currently deprecated as of writing this, so you would need to pass `--provider virtualbox` instead – Adam Comerford Sep 25 '14 at 16:22
  • 1
    If the box is already provisioned, removing the base box did nothing to force a reprovision. Only a vagrant destroy, vagrant up works to download and deploy off a new base. – Thinkable Sep 23 '15 at 01:15