Fix Issue 4307: FreeBSD fix interface device names in /etc/rc.conf
https://github.com/mitchellh/vagrant/issues/4307 Fix details: Pass network interface name to template renderer and use it in static and dhcp templates to render /etc/rc.conf entries. modified: plugins/guests/freebsd/cap/configure_networks.rb modified: templates/guests/freebsd/network_dhcp.erb modified: templates/guests/freebsd/network_static.erb Verification scenario: Check if /etc/rc.conf contains vtnet entries when paravirtualized NIC devices are used in FreeBSD guest.
This commit is contained in:
parent
ac0d213c9b
commit
c43ab95f86
|
@ -27,7 +27,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
|
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
|
||||||
options: network)
|
options: network, ifname: ifname)
|
||||||
|
|
||||||
# Write the entry to a temporary location
|
# Write the entry to a temporary location
|
||||||
temp = Tempfile.new("vagrant")
|
temp = Tempfile.new("vagrant")
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#VAGRANT-BEGIN
|
#VAGRANT-BEGIN
|
||||||
ifconfig_em<%= options[:interface] %>="DHCP"
|
ifconfig_em<%= ifname %>="DHCP"
|
||||||
#VAGRANT-END
|
#VAGRANT-END
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#VAGRANT-BEGIN
|
#VAGRANT-BEGIN
|
||||||
ifconfig_em<%= options[:interface] %>="inet <%= options[:ip] %> netmask <%= options[:netmask] %>"
|
ifconfig_<%= ifname %>="inet <%= options[:ip] %> netmask <%= options[:netmask] %>"
|
||||||
#VAGRANT-END
|
#VAGRANT-END
|
||||||
|
|
Loading…
Reference in New Issue