Fix line breaks
This commit is contained in:
parent
6e3656ad71
commit
9d1834a3c9
|
@ -11,20 +11,14 @@ module VagrantPlugins
|
||||||
|
|
||||||
def self.configure_networks(machine, networks)
|
def self.configure_networks(machine, networks)
|
||||||
interfaces = Array.new
|
interfaces = Array.new
|
||||||
machine.communicate.sudo("ip -o -0 addr | grep -v LOOPBACK | awk
|
machine.communicate.sudo("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'") do |_, result|
|
||||||
'{print $2}' | sed 's/://'") do |_, result|
|
|
||||||
interfaces = result.split("\n")
|
interfaces = result.split("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
networks.each do |network|
|
networks.each do |network|
|
||||||
# We use :device in the template instead of
|
|
||||||
# eth#{network[:interface]} in order to support Predictable
|
|
||||||
# Network Interfaces
|
|
||||||
network[:device] = interfaces[network[:interface]]
|
network[:device] = interfaces[network[:interface]]
|
||||||
|
|
||||||
entry =
|
entry = TemplateRenderer.render("guests/arch/network_#{network[:type]}", options: network)
|
||||||
TemplateRenderer.render("guests/arch/network_#{network[:type]}",
|
|
||||||
options: network)
|
|
||||||
|
|
||||||
temp = Tempfile.new("vagrant")
|
temp = Tempfile.new("vagrant")
|
||||||
temp.binmode
|
temp.binmode
|
||||||
|
@ -32,10 +26,8 @@ module VagrantPlugins
|
||||||
temp.close
|
temp.close
|
||||||
|
|
||||||
machine.communicate.upload(temp.path, "/tmp/vagrant_network")
|
machine.communicate.upload(temp.path, "/tmp/vagrant_network")
|
||||||
machine.communicate.sudo("mv /tmp/vagrant_network
|
machine.communicate.sudo("mv /tmp/vagrant_network /etc/netctl/#{network[:device]}")
|
||||||
/etc/netctl/#{network[:device]}")
|
machine.communicate.sudo("ip link set #{network[:device]} down && netctl start #{network[:device]}")
|
||||||
machine.communicate.sudo("ip link set #{network[:device]} down &&
|
|
||||||
netctl start #{network[:device]}")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue