Vagrant – how to have host platform specific provisioning steps

Note that Vagrant itself, in the Vagrant::Util::Platform class already implements a more advanced version of the platform checking logic in the answer by BernardoSilva.

So in a Vagrantfile, you can simply use the following:

if Vagrant::Util::Platform.windows? then
    myHomeDir = ENV["USERPROFILE"]
else
    myHomeDir = "~"
end

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)