On Jun 10, 2013, at 11:26 AM, John Riker <
three...@gmail.com> wrote:
> Thanks...Something I want to distribute...I presume we add this to the vagrantfile provisioners. For some reason, vagrant reload is unable to find the source file, though I gave the absolute path as
>
> config.vm.provision :shell, :inline => "cp /users/xyz/abcd.xml /tmp/abcd.xml" I get the error as
>
It needs to be in a directory that's accessible to the vm. By default, the /vagrant directory inside the vm is mapped to the directory where your Vagrantfile is (which makes the most sense for files that are distributed with the vagrant config), but if you really must, you can add other synced folders and use one of those. So if you create a folder vm_files in the same directory as your Vagrantfile, it will be accessible from the vm at /vagrant/vm_files.
> [default] Running provisioner: Vagrant::Provisioners::Shell...
> cp:
> cannot stat `/users/xyz/abcd.xml'
> : No such file or directory
>
>
> On Monday, June 10, 2013 10:02:30 AM UTC-4, Adam Fields wrote:
>
> On Jun 10, 2013, at 1:54 AM, John Riker <
three...@gmail.com> wrote:
>
> > I believe this ruby script would allow me to copy a file from host to the guest system (scripted version, not manual copy). I want to add this as part of a custom recipe, but not sure what would be the wrapper/proviosioner that I should be using to get this working. Obviously the one below is not correct, since it is copied from provisioner section of vagrantfile.
>
> It kind of depends on what files you're copying and whether it's something you can distribute or needs to be specific to each host.
>
> For almost everything, I package them up in a subfolder in the vagrant config directory and then do something like this:
>
> config.vm.provision :shell, :inline => "cp /vagrant/vm_files/vm_hosts /etc/hosts"
>
>
> --
> 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
vagrant-up+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>