mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #47 from pronix/master
close #43 set key file in url
This commit is contained in:
commit
97a0677e85
@ -6,7 +6,7 @@ module VagrantPlugins
|
|||||||
module Action
|
module Action
|
||||||
class ConnectLibvirt
|
class ConnectLibvirt
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@logger = Log4r::Logger.new("vagrant_libvirt::action::connect_libvirt")
|
@logger = Log4r::Logger.new('vagrant_libvirt::action::connect_libvirt')
|
||||||
@app = app
|
@app = app
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -39,7 +39,11 @@ module VagrantPlugins
|
|||||||
uri << '://'
|
uri << '://'
|
||||||
uri << config.host if config.host
|
uri << config.host if config.host
|
||||||
end
|
end
|
||||||
|
|
||||||
uri << '/system?no_verify=1'
|
uri << '/system?no_verify=1'
|
||||||
|
# set ssh key for access to libvirt host
|
||||||
|
home_dir = `echo ${HOME}`.chomp
|
||||||
|
uri << "&keyfile=#{home_dir}/.ssh/id_rsa"
|
||||||
|
|
||||||
conn_attr = {}
|
conn_attr = {}
|
||||||
conn_attr[:provider] = 'libvirt'
|
conn_attr[:provider] = 'libvirt'
|
||||||
|
@ -12,8 +12,8 @@ module VagrantPlugins
|
|||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
env[:machine_ssh_info] = read_ssh_info(
|
env[:machine_ssh_info] = read_ssh_info(env[:libvirt_compute],
|
||||||
env[:libvirt_compute], env[:machine])
|
env[:machine])
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
|
@ -45,7 +45,7 @@ module VagrantPlugins
|
|||||||
# :username => "mitchellh",
|
# :username => "mitchellh",
|
||||||
# :private_key_path => "/path/to/my/key"
|
# :private_key_path => "/path/to/my/key"
|
||||||
#}
|
#}
|
||||||
env = @machine.action("read_ssh_info")
|
env = @machine.action('read_ssh_info')
|
||||||
env[:machine_ssh_info]
|
env[:machine_ssh_info]
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ module VagrantPlugins
|
|||||||
# Run a custom action we define called "read_state" which does
|
# Run a custom action we define called "read_state" which does
|
||||||
# what it says. It puts the state in the `:machine_state_id`
|
# what it says. It puts the state in the `:machine_state_id`
|
||||||
# key in the environment.
|
# key in the environment.
|
||||||
env = @machine.action("read_state")
|
env = @machine.action('read_state')
|
||||||
|
|
||||||
state_id = env[:machine_state_id]
|
state_id = env[:machine_state_id]
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|||||||
gem.require_paths = ["lib"]
|
gem.require_paths = ["lib"]
|
||||||
gem.version = VagrantPlugins::ProviderLibvirt::VERSION
|
gem.version = VagrantPlugins::ProviderLibvirt::VERSION
|
||||||
|
|
||||||
gem.add_runtime_dependency "fog", "~> 1.10.0"
|
gem.add_runtime_dependency "fog", "1.10.0"
|
||||||
gem.add_runtime_dependency "ruby-libvirt", "~> 0.4.0"
|
gem.add_runtime_dependency "ruby-libvirt", "~> 0.4.0"
|
||||||
|
|
||||||
gem.add_development_dependency "rake"
|
gem.add_development_dependency "rake"
|
||||||
|
Loading…
Reference in New Issue
Block a user