Skip to content

Instantly share code, notes, and snippets.

@cromulus
Last active June 13, 2016 19:55
Show Gist options
  • Save cromulus/5044b9558319769aaf0b to your computer and use it in GitHub Desktop.
Save cromulus/5044b9558319769aaf0b to your computer and use it in GitHub Desktop.
Passwordless nfs and hostmanager for vagrant
## add this to your /etc/sudoers file
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /Users/bill/.vagrant.d/tmp/hosts.local /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE, VAGRANT_HOSTMANAGER_UPDATE
# for vagrant-hostmanager
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <home-directory>/.vagrant.d/tmp/hosts.local /etc/hosts
%<admin-group> ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment