diff --git a/build_library/oem/vagrant/build/box/Vagrantfile b/build_library/oem/vagrant/build/box/Vagrantfile index 7bed8e3643..b58b5bf492 100644 --- a/build_library/oem/vagrant/build/box/Vagrantfile +++ b/build_library/oem/vagrant/build/box/Vagrantfile @@ -1,11 +1,8 @@ # -*- mode: ruby -*- # # vi: set ft=ruby : -if Vagrant::VERSION < "1.6.0" - raise "Need at least vagrant version 1.6.0, please update" -end +Vagrant.require_version ">= 2.2.5" -require_relative 'change_host_name.rb' require_relative 'configure_networks.rb' require_relative 'base_mac.rb' @@ -27,6 +24,10 @@ Vagrant.configure("2") do |config| # Fix docker not being able to resolve private registry in VirtualBox vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] + + if File.exist?("config.ign") + vb.customize ["guestproperty", "set", :id, "/Ignition/Config", File.read("config.ign")] + end end config.vm.provider :vmware_fusion do |vf| @@ -38,4 +39,9 @@ Vagrant.configure("2") do |config| prl.check_guest_tools = false prl.functional_psf = false end - end + + if File.exist?("user-data") + config.vm.provision :file, :source => "user-data", :destination => "/tmp/vagrantfile-user-data" + config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/flatcar-vagrant/", :privileged => true + end +end diff --git a/build_library/oem/vagrant/build/box/change_host_name.rb b/build_library/oem/vagrant/build/box/change_host_name.rb deleted file mode 100644 index bae625e235..0000000000 --- a/build_library/oem/vagrant/build/box/change_host_name.rb +++ /dev/null @@ -1,37 +0,0 @@ -# -*- mode: ruby -*- -# # vi: set ft=ruby : - -# NOTE: This monkey-patching of the coreos guest plugin is a terrible -# hack that needs to be removed once the upstream plugin works with -# alpha CoreOS images. - -require 'tempfile' -require Vagrant.source_root.join("plugins/guests/coreos/cap/change_host_name.rb") - -CLOUD_CONFIG = <