I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.
I don\'t want to do so via traditional provisioners (Pup
If you are restrained from having the files in your directory, you can run this code in a script file from the Host machine.
#!/bin/sh
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} /File/To/Copy vagrant@YourServer:/Where/To/Put/File
In this setup, you only need to change /File/To/Copy to the file or files you want to copy and then /Where/To/Put/File is the location on the VM you wish to have the files copied to.
If you create this file and call it copyToServer.sh you can then run the sh command to push those files.
sh ./copyToServer.sh
As a final note, you cannot run this code as a provisioner because that runs on the Guest server, while this code runs from the Host.