firen
firen

Reputation: 1424

Restart VM during Vagrant provisioning

I am trying to setup vagrant + chef configuration. One of provisioning actions requires me to change locales on the server. When I change locales I must restart VM or relogin to that take effect. Any idea if it is possible in Vagrant?

Upvotes: 4

Views: 1989

Answers (1)

ukabu
ukabu

Reputation: 86

I wrote a simple provisioner to be able to do just that.

https://gist.github.com/ukabu/6780121

This works for Windows Guest and the VirtualBox provider (could be adapted easily for other OSes or providers).

With it you can do :

config.vm.provision :chef_solo do |chef|
  # run list for stuff that needs to be done before a reboot
end
config.vm.provision :reboot
config.vm.provision :chef_solo do |chef|
  # run list for stuff that needs to be done after a reboot
end

Upvotes: 4

Related Questions