mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
v0.0.6
* Routed networks support. * SSH configurable params in Vagrantfile. * Updated README file.
This commit is contained in:
@@ -45,6 +45,8 @@ module VagrantPlugins
|
||||
@options = scoped_hash_override(options, :libvirt)
|
||||
@options = {
|
||||
:netmask => '255.255.255.0',
|
||||
:dhcp_enabled => true,
|
||||
:forward_mode => 'nat',
|
||||
}.merge(@options)
|
||||
|
||||
# Prepare a hash describing network for this specific interface.
|
||||
@@ -201,14 +203,9 @@ module VagrantPlugins
|
||||
@network_address = @interface_network[:ip_address]
|
||||
@network_netmask = @interface_network[:netmask]
|
||||
|
||||
if @options[:isolated]
|
||||
@network_forward_mode = false
|
||||
else
|
||||
@network_forward_mode = 'nat'
|
||||
|
||||
if @options[:nat_interface]
|
||||
@network_nat_interface = @options[:nat_interface]
|
||||
end
|
||||
@network_forward_mode = @options[:forward_mode]
|
||||
if @options[:forward_device]
|
||||
@network_forward_device = @options[:forward_device]
|
||||
end
|
||||
|
||||
if @options[:dhcp_enabled]
|
||||
|
||||
@@ -40,14 +40,19 @@ module VagrantPlugins
|
||||
}
|
||||
raise Errors::NoIpAddressError if not ip_address
|
||||
|
||||
# Return the info
|
||||
# TODO: Some info should be configurable in Vagrantfile
|
||||
return {
|
||||
ssh_info = {
|
||||
:host => ip_address,
|
||||
:port => 22,
|
||||
:forward_agent => true,
|
||||
:forward_x11 => true,
|
||||
:port => machine.config.ssh.guest_port,
|
||||
:username => machine.config.ssh.username,
|
||||
:forward_agent => machine.config.ssh.forward_agent,
|
||||
:forward_x11 => machine.config.ssh.forward_x11,
|
||||
}
|
||||
|
||||
if not ssh_info[:username]
|
||||
ssh_info[:username] = machine.config.ssh.default.username
|
||||
end
|
||||
|
||||
ssh_info
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<name><%= @network_name %></name>
|
||||
<bridge name="<%= @network_bridge_name %>" />
|
||||
|
||||
<% if @network_forward_mode != false %>
|
||||
<% if @network_nat_interface %>
|
||||
<forward mode="<%= @network_forward_mode %>" dev="<%= @network_nat_interface %>" />
|
||||
<% if @network_forward_mode != 'none' %>
|
||||
<% if @network_forward_device %>
|
||||
<forward mode="<%= @network_forward_mode %>" dev="<%= @network_forward_device %>" />
|
||||
<% else %>
|
||||
<forward mode="<%= @network_forward_mode %>" />
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module VagrantPlugins
|
||||
module Libvirt
|
||||
VERSION = "0.0.5"
|
||||
VERSION = "0.0.6"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user