Force Vagrant to re-provision or download a new bo

2019-04-19 11:00发布

问题:

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

回答1:

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


标签: vagrant