FreeBSD guest network config upload must be a file.

This commit is contained in:
Mitchell Hashimoto 2012-06-22 20:56:41 -07:00
parent d8c16035c8
commit 76f7da0618
1 changed files with 8 additions and 1 deletions

View File

@ -51,7 +51,14 @@ module VagrantPlugins
networks.each do |network|
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
:options => network)
vm.channel.upload(StringIO.new(entry), "/tmp/vagrant-network-entry")
# Write the entry to a temporary location
temp = Tempfile.new("vagrant")
temp.binmode
temp.write(entry)
temp.close
vm.channel.upload(temp.path, "/tmp/vagrant-network-entry")
vm.channel.sudo("su -m root -c 'cat /tmp/vagrant-network-entry >> /etc/rc.conf'")
vm.channel.sudo("rm /tmp/vagrant-network-entry")