4

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?

firen
  • 1,384
  • 2
  • 14
  • 32
  • The hostname cookbook [restarts Chef](https://github.com/franco/chef-hostname/blob/master/recipes/default.rb#L68) to let the new hostname take effect, maybe that's a starting point. – cmur2 Apr 13 '13 at 07:38

1 Answers1

4

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
ukabu
  • 86
  • 4