Just configure a few default variables to store vagrant images in a custom path, and set libvirt as default provider
# Vagrant stuff
export VAGRANT_DEFAULT_PROVIDER=libvirt
export VAGRANT_HOME=/storage/vagrant
Create a default Vagrantfile that will be "included" on each vagrant up command, and set the default user/pass, libvirt stuff,...
Vagrant.configure(2) do |config|
# Red Hat Access data
config.registration.username = 'user'
config.registration.password = 'password'
config.vm.provider "libvirt" do |libvirt|
libvirt.driver = "kvm"
libvirt.uri = "qemu:///system"
libvirt.storage_pool_name= "VMs"
end
# Virtual Network name
config.vm.network :private_network, :libvirt__network_name => 'minwi.lan'
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
end
Avoid entering your password to update the /etc/hosts every time
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /storage/vagrant/tmp/hosts.local /etc/hosts
eminguez ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
Allow your user to manage libvirt without asking for password
[Allow eminguez libvirt management permissions]
Identity=unix-user:eminguez
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes