Skip to content

Commit

Permalink
vagrant: Set NFS to not use UDP
Browse files Browse the repository at this point in the history
NFS 4 defaults to not allow UDP due to security concerns
  • Loading branch information
biinari committed Oct 4, 2024
1 parent b8ab68b commit 9ce02d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ Vagrant.configure('2') do |config|
fail_with_message "vagrant-bindfs missing, please install the plugin with this command:\nvagrant plugin install vagrant-bindfs"
else
trellis_config.wordpress_sites.each_pair do |name, site|
config.vm.synced_folder local_site_path(site), nfs_path(name), type: 'nfs'
config.vm.synced_folder local_site_path(site), nfs_path(name), type: 'nfs', nfs_udp: false
config.bindfs.bind_folder nfs_path(name), remote_site_path(name, site), u: 'vagrant', g: 'www-data', o: 'nonempty'
end

config.vm.synced_folder ANSIBLE_PATH, '/ansible-nfs', type: 'nfs'
config.vm.synced_folder ANSIBLE_PATH, '/ansible-nfs', type: 'nfs', nfs_udp: false
config.bindfs.bind_folder '/ansible-nfs', ANSIBLE_PATH_ON_VM, o: 'nonempty', p: '0644,a+D'
config.bindfs.bind_folder bin_path, bin_path, perms: '0755'
end
Expand All @@ -105,6 +105,7 @@ Vagrant.configure('2') do |config|
mount_options: folder.fetch('mount_options', [])
}

options[:nfs_udp] = folder.fetch('nfs_udp', false) if folder.fetch('type', 'nfs') == 'nfs'
destination_folder = folder.fetch('bindfs', true) ? nfs_path(folder['destination']) : folder['destination']

config.vm.synced_folder folder['local_path'], destination_folder, options
Expand Down

0 comments on commit 9ce02d9

Please sign in to comment.