Skip to content

Commit

Permalink
Issue geerlingguy#1375: Allow /vagrant synced folder to be overridden…
Browse files Browse the repository at this point in the history
… through vagrant_synced_folders
  • Loading branch information
oxyc committed May 30, 2017
1 parent ee8eaaf commit 1a36bb5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ Vagrant.configure('2') do |config|
config.hostmanager.aliases = aliases
end

# Sync the project root directory to /vagrant
unless vconfig['vagrant_synced_folders'].any? { |synced_folder| synced_folder.destination == '/vagrant' }
vconfig['vagrant_synced_folders'].push(
local_path: host_project_dir,
destination: '/vagrant'
)
end

# Synced folders.
vconfig['vagrant_synced_folders'].each do |synced_folder|
options = {
Expand All @@ -91,9 +99,6 @@ Vagrant.configure('2') do |config|
config.vm.synced_folder synced_folder.fetch('local_path'), synced_folder.fetch('destination'), options
end

# Allow override of the default synced folder type.
config.vm.synced_folder host_project_dir, '/vagrant', type: vconfig['vagrant_synced_folder_default_type']

config.vm.provision provisioner do |ansible|
ansible.playbook = playbook
ansible.extra_vars = {
Expand Down

0 comments on commit 1a36bb5

Please sign in to comment.