Merge pull request #2023 from sevos/core_os_ext1

Cleanup of CoreOS guest plugin
This commit is contained in:
Mitchell Hashimoto 2013-08-03 22:29:02 -07:00
commit 1c057191cb
1 changed files with 5 additions and 11 deletions

View File

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