如何重置Vagrant 1.6.3配置状态?

如何重置Vagrant 1.6.3配置状态?,vagrant,provisioning,Vagrant,Provisioning,背景: 我的团队分发通过vagrant提供的箱子。这些盒子经常被用作需要额外供应的基本盒子。Vagrant版本是MacOSX 10.9.3上的1.6.3 问题: vagrant检测到该框始终已设置,并且默认情况下跳过设置阶段,除非通过--provision或vagrant provision强制执行。我希望使用先前配置的盒子的团队能够与分布式盒子交互,而不需要使用配置标志 问题: 如何检测并重置该框的已设置状态,使其在默认情况下重新运行设置程序 示例: 样本文件: Vagrant.configu

背景: 我的团队分发通过vagrant提供的箱子。这些盒子经常被用作需要额外供应的基本盒子。Vagrant版本是MacOSX 10.9.3上的1.6.3

问题: vagrant检测到该框始终已设置,并且默认情况下跳过设置阶段,除非通过--provision或vagrant provision强制执行。我希望使用先前配置的盒子的团队能够与分布式盒子交互,而不需要使用配置标志

问题: 如何检测并重置该框的已设置状态,使其在默认情况下重新运行设置程序

示例:

样本文件:

Vagrant.configure(“2”)do | config|
config.vm.box=“chef/centos-6.5”
config.vm.provision“shell”,内联:“echo Hello,World”
结束
最初的流浪者行动:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'chef/centos-6.5'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: example-delme_default_1409678677244_49440
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2202 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2202
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/user/temp/example-delme
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Hello, World
$ vagrant halt -f && vagrant up
==> default: Forcing shutdown of VM...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2202 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2202
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/user/temp/example-delme
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.
第二个流浪汉:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'chef/centos-6.5'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: example-delme_default_1409678677244_49440
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2202 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2202
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/user/temp/example-delme
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Hello, World
$ vagrant halt -f && vagrant up
==> default: Forcing shutdown of VM...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2202 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2202
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/user/temp/example-delme
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

问题显示在控制台输出“机器已配置”中。

您的示例没有问题,默认情况下,配置仅在first up上运行。您的整个工作流程是什么样子的?它是这样的:您从basebox开始,设置它,将它打包到box中,将box复制到其他人,将box添加到vagrant,vagrant up?看起来您需要使用错误消息中指示的--provision标志或
vagrant provision
。签出:@nikhil指定供应选项是我想要的avoid@MichaelS工作流程如您所指定。我一直在想,也许我应该用packer来“分叉”一个basebox。我确实发现了一个漏洞,删除了
.vagrant\machines\minimal\virtualbox\action\u provision
,这会导致下一次我
启动
重新加载
时出现一个隐式的provision。