Added an option to set the path to the libvirt socket

This commit is contained in:
Matthieu Coudron 2014-03-11 14:47:36 +01:00
parent 135e480aef
commit 97140039bd
3 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,7 @@ This provider exposes quite a few provider-specific configuration options:
* `username` - Username and password to access Libvirt.
* `password` - Password to access Libvirt.
* `id_ssh_key_file` - The id ssh key file name to access Libvirt (eg: id_dsa or id_rsa or ... in the user .ssh directory)
* `socket` - Path to the libvirt unix socket (eg: /var/run/libvirt/libvirt-sock)
* `storage_pool_name` - Libvirt storage pool name, where box image and instance snapshots will be stored.
### Domain Specific Options

View File

@ -59,6 +59,8 @@ module VagrantPlugins
home_dir = `echo ${HOME}`.chomp
uri << "\&keyfile=#{home_dir}/.ssh/"+config.id_ssh_key_file
end
# set path to libvirt socket
uri << "\&socket="+config.socket if config.socket
conn_attr = {}
conn_attr[:provider] = 'libvirt'

View File

@ -12,6 +12,9 @@ module VagrantPlugins
# If use ssh tunnel to connect to Libvirt.
attr_accessor :connect_via_ssh
# Path towards the libvirt socket
attr_accessor :socket
# The username to access Libvirt.
attr_accessor :username