I am trying to provision a VM, using Vagrant and virtual-box, for development and I am unable to access the /vagrant folder where I had expected my base configuration files to be, to copy to their locations.
My directory structure is:
provision/
install.sh
config/
nginx/mydomain
Vagrantfile
The contents of the Vagrantfile are as follows:
require 'yaml'
myproject_version = "0.22.1"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/vagrant", create: true, group: "ubuntu", owner: "ubuntu"
config.vm.provider :virtualbox do |vb, override|
vb.name = 'myprojectserver-dev-standalone'
# please customize hostname and private ip configuration if you needed.
override.vm.hostname = "myhost"
# frontend-webui
override.vm.network :forwarded_port, guest: 5050, host: 5050
# admin-webui
override.vm.network :forwarded_port, guest: 8080, host: 8080
# services
override.vm.network :forwarded_port, guest: 8081, host: 8081
override.vm.provision :shell do |s|
s.path = "provision/install.sh"
s.args = "/home/ubuntu ubuntu"
end
end
end
In my script I try:
ls -l /vagrant/
cp /vagrant/provision/config/nginx/mydomain
The problem is that the /vagrant directory doesn't exist. I tried creating it manually and then re-ruing the provision process, but no change.
Can anyone suggest what I may be doing wrong?
