Cleanup of CoreOS guest plugin

This commit is contained in:
Artur Roszczyk 2013-08-04 02:15:37 +02:00
parent 9f9b0589f9
commit bf21021cfc
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