Merge pull request #2023 from sevos/core_os_ext1
Cleanup of CoreOS guest plugin
This commit is contained in:
commit
1c057191cb
|
@ -10,24 +10,20 @@ module VagrantPlugins
|
||||||
|
|
||||||
def self.configure_networks(machine, networks)
|
def self.configure_networks(machine, networks)
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
# Remove any previous host only network additions to the interface file
|
# Disable default etcd
|
||||||
comm.sudo("systemctl stop etcd")
|
comm.sudo("systemctl stop etcd")
|
||||||
|
|
||||||
primary_machine = machine.env.active_machines
|
# Read network interface names
|
||||||
#machine.env[:primary_machine].provider.driver.read_network_interfaces
|
|
||||||
#puts machine.env['admin1'].provider_config.network_adapters
|
|
||||||
#puts primary_machine
|
|
||||||
|
|
||||||
# Configure each network interface
|
|
||||||
interfaces = []
|
interfaces = []
|
||||||
comm.sudo("ifconfig | grep enp0 | cut -f1 -d:") do |_, result|
|
comm.sudo("ifconfig | grep enp0 | cut -f1 -d:") do |_, result|
|
||||||
interfaces = result.split("\n")
|
interfaces = result.split("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Configure interfaces
|
||||||
|
# FIXME: fix matching of interfaces with IP adresses
|
||||||
networks.each do |network|
|
networks.each do |network|
|
||||||
comm.sudo("ifconfig #{interfaces[network[:interface].to_i]} #{network[:ip]} netmask #{network[:netmask]}")
|
comm.sudo("ifconfig #{interfaces[network[:interface].to_i]} #{network[:ip]} netmask #{network[:netmask]}")
|
||||||
end
|
end
|
||||||
puts 'TODO start etcd'
|
|
||||||
|
|
||||||
primary_machine_config = machine.env.active_machines.first
|
primary_machine_config = machine.env.active_machines.first
|
||||||
primary_machine = machine.env.machine(*primary_machine_config, true)
|
primary_machine = machine.env.machine(*primary_machine_config, true)
|
||||||
|
@ -51,9 +47,7 @@ module VagrantPlugins
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
puts entry
|
Tempfile.open("vagrant") do |temp|
|
||||||
|
|
||||||
Tempfile.open("vagrant", '.') do |temp|
|
|
||||||
temp.binmode
|
temp.binmode
|
||||||
temp.write(entry)
|
temp.write(entry)
|
||||||
temp.close
|
temp.close
|
||||||
|
|
Loading…
Reference in New Issue