From b1294b062dcb1151a910208401cd1715181eafcc Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 27 Apr 2014 17:52:47 -0400 Subject: [PATCH] fix(coreos-base/oem-vagrant): Split up plugin, use change_host_name hook. The old override-plugin.rb didn't actually properly monkey patch the change host name function because it was missing a requires line pointing to the file it is defined in upstream. To clarify things split the code into two files that match the upstream names. Additionally using this hook as it is intended means it works if a host name is defined but additional networks are not. As part of the split switch to starting the units directly. The indirection through a path unit just adds complexity. --- .../oem-vagrant/files/box/Vagrantfile | 3 +- .../oem-vagrant/files/box/change_host_name.rb | 37 +++++++++++++++++++ ...erride-plugin.rb => configure_networks.rb} | 28 ++------------ .../oem-vagrant/files/cloud-config.yml | 7 ---- 4 files changed, 43 insertions(+), 32 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/change_host_name.rb rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/{override-plugin.rb => configure_networks.rb} (77%) 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 055355aefa..db24837d3f 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 @@ -5,7 +5,8 @@ if Vagrant::VERSION < "1.5.0" raise "Need at least vagrant version 1.5.0, please update" end -require_relative 'override-plugin.rb' +require_relative 'change_host_name.rb' +require_relative 'configure_networks.rb' Vagrant.configure("2") do |config| # SSH in as the default 'core' user, it has the vagrant ssh key. diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/change_host_name.rb b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/change_host_name.rb new file mode 100644 index 0000000000..dfab7916be --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/box/change_host_name.rb @@ -0,0 +1,37 @@ +# -*- 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 = <