From e6244ef10cd1f568946bba98ff27280bad14bd87 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sat, 26 Apr 2014 23:23:46 -0400 Subject: [PATCH] add(coreos-base/oem-vagrant): Import code from coreos-vagrant Import override-plugin.rb and some VirtualBox fixups from our published Vagrantfile repo. The current Vagrant OEM depends on this code, making it impossible to boot without using our special Vagrantfile. Using the box as a stand-alone entity worked up until recently and is something users expect to work. Also bump the minimum Vagrant version to 1.5, matching our current documentation. Fixes https://github.com/coreos/bugs/issues/5 --- .../oem-vagrant/files/box/Vagrantfile | 18 ++- .../oem-vagrant/files/box/override-plugin.rb | 117 ++++++++++++++++++ 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/override-plugin.rb diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/Vagrantfile b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/Vagrantfile index 50fe4487d9..055355aefa 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/Vagrantfile +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/Vagrantfile @@ -1,11 +1,25 @@ -if Vagrant::VERSION < "1.2.3" - raise "Need at least vagrant version 1.2.3, please update" +# -*- mode: ruby -*- +# # vi: set ft=ruby : + +if Vagrant::VERSION < "1.5.0" + raise "Need at least vagrant version 1.5.0, please update" end +require_relative 'override-plugin.rb' + Vagrant.configure("2") do |config| # SSH in as the default 'core' user, it has the vagrant ssh key. config.ssh.username = "core" # Disable the base shared folder, guest additions are unavailable. config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.provider :virtualbox do |vb| + # Guest Additions are unavailable. + vb.check_guest_additions = false + + # Fix docker not being able to resolve private registry in VirtualBox + vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] + vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] + end end diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/override-plugin.rb b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/override-plugin.rb new file mode 100644 index 0000000000..eb0bc99589 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/override-plugin.rb @@ -0,0 +1,117 @@ +# -*- 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 'ipaddr' +require Vagrant.source_root.join("plugins/guests/coreos/cap/configure_networks.rb") + +BASE_CLOUD_CONFIG = <