lee-pai-long
2/5/2016 - 3:15 PM

hostmanager-passwordless-sudo_vagrant.md

[VAGRANT] Passwordless sudo for the vagrant-hostmanager plugin


Create a file in the sudoers.d directory

$ [sudo] vim /etc/sudoers.d/vagrant-hostmanager

Put this two line in it

Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <HOME>/.vagrant.d/tmp/hosts.local /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE

Note: In debian-like distribution the sudoer group is called sudo whereas in RHEL familly the group is wheel so change the second line consenquently