Hi,
I'm trying to set a specific locale (ISO-8859-1) with a Vagrant provision script but I'm having trouble getting it to work.
For the locale change to take effect you need to log back into the machine (I think), so I thought having multiple provision scripts would do the trick.
Vagrantfile provision
config.vm.provision "shell", path: "provision_locale.sh"
config.vm.provision "shell", path: "provision.sh"
provision_locale.sh
locale-gen en_GB
update-locale LANG=en_GB.ISO-8859-1
The second provision script installs Java and starts a Jenkins swarm process to connect as a Jenkins Slave. When I run builds on the VM I get a lot of test failures around the locale (as if its not been set correctly).
If I remove ""provision_locale.sh" from the Vagrantfile and set the locale using "vagrant ssh" everything seems to work OK.
# This seems to work
vagrant up --no-provision
vagrant ssh -c "sudo locale-gen en_GB"
vagrant ssh -c "sudo update-locale LANG=en_GB.ISO-8859-1"
vagrant provision # single provsion script in Vagrantfile - provision.sh
So why doesn't this work with 2 separate provision scripts? Does Vagrant only connect to the VM once for all provision scripts, I assumed it would re-connect for each provision script so it would behave in the same was as the "vagrant ssh" commands.
Thanks,
Rich.