* Routed networks support.
* SSH configurable params in Vagrantfile.
* Updated README file.
This commit is contained in:
pradels
2013-07-24 15:44:30 +02:00
parent 2edd384f8e
commit d05196692c
7 changed files with 75 additions and 31 deletions

View File

@@ -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]

View File

@@ -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

View File

@@ -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 %>

View File

@@ -1,5 +1,5 @@
module VagrantPlugins
module Libvirt
VERSION = "0.0.5"
VERSION = "0.0.6"
end
end