That's it Alvaro! Thanks! Now I can complete my script without strange workarounds :)
On Sunday, July 27, 2014 1:31:46 AM UTC+2, Alvaro Miranda Aguilera wrote: > > i think you are trying to load the yaml file like 'file.yaml' and should > be like path-to-vagrantfile + 'file.yaml' > > as an example, something like this > > File.dirname(__FILE__) > > should tell you the full path where Vagrantfile is > > a sample use: > > > http://mkrmr.wordpress.com/2012/08/12/add-your-own-customization-to-vagrant-boxes/ > > > config.vm.share_folder "v-dotfiles", "/home/vagrant/.dotfiles", File > .expand_path("~/.dotfiles") > config.vm.provision :shell, :path => File.join(File.dirname(__FILE__), > "scripts", "provision") > > > > > On Fri, Jul 25, 2014 at 6:02 AM, David Campos <[email protected] > <javascript:>> wrote: > >> Hello all, >> >> I have created a Vagrant box that is being configured and provisioned >> based on a YAML file allocated at the same folder as the VagrantFile. That >> approach allows me to configure most settings through the yaml and leave >> programming on the Vagrantfile based on the provided variables. >> >> The problem is that, even though this approach works perfectly when I am >> running vagrant from the 'CWD' folder (where the Vagrantfile is stored), it >> does not work for the remote command calls. When I call the 'vagrant up >> <machineid>' it fails: >> >> vagrant up 6bb08b1 >> There was an error loading a Vagrantfile. The file being loaded >> and the error message are shown below. This is usually caused by >> a syntax error. >> >> Path: /Users/user.name/work/vm/vagrant/boxes/Vagrantfile >> Message: No such file or directory - vagrant.yml >> >> I have tried to load load the file using ENV variables or params as >> prefixes with different fail levels (ENV vars are not portable) so I was >> wondering... If Vagrant knows where the Vagrantfile is, can't I access to >> that variable and use the prefix for my load? Is that possible? How can I >> do it? >> >> I have not been able to find any variable inside the Vagrantfile object >> at runtime. >> >> Thanks for your help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Vagrant" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
