Update CHANGELOG
This commit is contained in:
parent
d6a872f501
commit
2057d513cb
|
@ -23,8 +23,7 @@ FEATURES:
|
||||||
IMPROVEMENTS:
|
IMPROVEMENTS:
|
||||||
|
|
||||||
- commands/ssh-config: Works without a target in multi-machine envs [GH-2844]
|
- commands/ssh-config: Works without a target in multi-machine envs [GH-2844]
|
||||||
- guests/freebsd: Added `config.freebsd.device` setting to set the network
|
- guests/freebsd: Support for virtio interfaces. [GH-3082]
|
||||||
device prefix, defaults to "em". [GH-2956]
|
|
||||||
- guests/openbsd: Support for virtio interfaces. [GH-3082]
|
- guests/openbsd: Support for virtio interfaces. [GH-3082]
|
||||||
|
|
||||||
PLUGIN AUTHOR CHANGES:
|
PLUGIN AUTHOR CHANGES:
|
||||||
|
|
|
@ -13,7 +13,19 @@ module VagrantPlugins
|
||||||
machine.communicate.sudo("sed -i '' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf", {:shell => "sh"})
|
machine.communicate.sudo("sed -i '' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf", {:shell => "sh"})
|
||||||
|
|
||||||
networks.each do |network|
|
networks.each do |network|
|
||||||
device = "#{machine.config.freebsd.device}#{network[:interface]}"
|
# Determine the interface prefix...
|
||||||
|
command = "ifconfig -a | grep -o ^[0-9a-z]*"
|
||||||
|
result = ""
|
||||||
|
ifname = ""
|
||||||
|
machine.communicate.execute(command) do |type, data|
|
||||||
|
result << data if type == :stdout
|
||||||
|
if result.split(/\n/).any?{|i| i.match(/vio*/)}
|
||||||
|
ifname = "vio#{network[:interface]}"
|
||||||
|
else
|
||||||
|
ifname = "em#{network[:interface]}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
|
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
|
||||||
:options => network)
|
:options => network)
|
||||||
|
|
||||||
|
@ -28,9 +40,9 @@ module VagrantPlugins
|
||||||
machine.communicate.sudo("rm /tmp/vagrant-network-entry", {:shell => "sh"})
|
machine.communicate.sudo("rm /tmp/vagrant-network-entry", {:shell => "sh"})
|
||||||
|
|
||||||
if network[:type].to_sym == :static
|
if network[:type].to_sym == :static
|
||||||
machine.communicate.sudo("ifconfig #{device} inet #{network[:ip]} netmask #{network[:netmask]}", {:shell => "sh"})
|
machine.communicate.sudo("ifconfig #{ifname} inet #{network[:ip]} netmask #{network[:netmask]}", {:shell => "sh"})
|
||||||
elsif network[:type].to_sym == :dhcp
|
elsif network[:type].to_sym == :dhcp
|
||||||
machine.communicate.sudo("dhclient #{device}", {:shell => "sh"})
|
machine.communicate.sudo("dhclient #{ifname}", {:shell => "sh"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module GuestFreeBSD
|
|
||||||
class Config < Vagrant.plugin("2", :config)
|
|
||||||
# The device prefix for network devices created by Vagrant.
|
|
||||||
# This defaults to "em" but can be set for example to "vtnet"
|
|
||||||
# for virtio devices and so on.
|
|
||||||
#
|
|
||||||
# @return [String]
|
|
||||||
attr_accessor :device
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
@device = UNSET_VALUE
|
|
||||||
end
|
|
||||||
|
|
||||||
def finalize!
|
|
||||||
@device = "em" if @device == UNSET_VALUE
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -6,11 +6,6 @@ module VagrantPlugins
|
||||||
name "FreeBSD guest"
|
name "FreeBSD guest"
|
||||||
description "FreeBSD guest support."
|
description "FreeBSD guest support."
|
||||||
|
|
||||||
config("freebsd") do
|
|
||||||
require File.expand_path("../config", __FILE__)
|
|
||||||
Config
|
|
||||||
end
|
|
||||||
|
|
||||||
guest("freebsd") do
|
guest("freebsd") do
|
||||||
require File.expand_path("../guest", __FILE__)
|
require File.expand_path("../guest", __FILE__)
|
||||||
Guest
|
Guest
|
||||||
|
|
|
@ -18,10 +18,10 @@ module VagrantPlugins
|
||||||
temp.write(entry)
|
temp.write(entry)
|
||||||
temp.close
|
temp.close
|
||||||
|
|
||||||
|
# Determine the interface prefix...
|
||||||
command = "ifconfig -a | grep -o ^[0-9a-z]*"
|
command = "ifconfig -a | grep -o ^[0-9a-z]*"
|
||||||
result = ""
|
result = ""
|
||||||
ifname = ""
|
ifname = ""
|
||||||
|
|
||||||
machine.communicate.execute(command) do |type, data|
|
machine.communicate.execute(command) do |type, data|
|
||||||
result << data if type == :stdout
|
result << data if type == :stdout
|
||||||
if result.split(/\n/).any?{|i| i.match(/vio*/)}
|
if result.split(/\n/).any?{|i| i.match(/vio*/)}
|
||||||
|
@ -30,6 +30,7 @@ module VagrantPlugins
|
||||||
ifname = "em#{network[:interface]}"
|
ifname = "em#{network[:interface]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
machine.communicate.upload(temp.path, "/tmp/vagrant-network-entry")
|
machine.communicate.upload(temp.path, "/tmp/vagrant-network-entry")
|
||||||
machine.communicate.sudo("mv /tmp/vagrant-network-entry /etc/hostname.#{ifname}")
|
machine.communicate.sudo("mv /tmp/vagrant-network-entry /etc/hostname.#{ifname}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue