Skip to content

Commit

Permalink
FreeBSD guest network config upload must be a file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jun 23, 2012
1 parent d8c1603 commit 76f7da0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/guests/freebsd/guest.rb
Expand Up @@ -51,7 +51,14 @@ def configure_networks(networks)
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")

Expand Down

0 comments on commit 76f7da0

Please sign in to comment.