From df0f7249c4db78293d78f63e05a586ceb9847a36 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 21 Nov 2016 11:51:51 -0500 Subject: [PATCH] vagrant: Make landrush optional It's not packaged for Fedora right now, I'm using Atomic Workstation where I'm trying to minimize stuff installed on the host, and finally even if I did run it, I use dnsmasq for the whole system, plus libvirt already uses dnsmasq, so networking gets super complicated with another resolver. This will make it easier for me to hack on this for now...I'll probably investigate landrush at some point though. --- vagrant/Vagrantfile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index ab3cf274b..4c030b1ee 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -15,17 +15,21 @@ origin_os = ENV['ORIGIN_OS'] || 'centos' rhsm_pool = ENV['RHSM_POOL'] || 'Employee SKU' sync_type = ENV['SYNC_TYPE'] || '' +REQUIRED_PLUGINS = %w(vagrant-hostmanager) +SUGGESTED_PLUGINS = %w(vagrant-sshfs landrush) + +def message(name) + "#{name} plugin is not installed, run `vagrant plugin install #{name}` to install it." +end + +SUGGESTED_PLUGINS.each { |plugin| print("note: " + message(plugin) + "\n") unless Vagrant.has_plugin?(plugin) } + if deployment_type == 'openshift-enterprise' - REQUIRED_PLUGINS = %w(vagrant-registration vagrant-hostmanager landrush) -else - REQUIRED_PLUGINS = %w(vagrant-hostmanager landrush) + REQUIRED_PLUGINS.push('vagrant-registration') end errors = [] -def message(name) - "#{name} plugin is not installed, run `vagrant plugin install #{name}` to install it." -end # Validate and collect error message if plugin is not installed REQUIRED_PLUGINS.each { |plugin| errors << message(plugin) unless Vagrant.has_plugin?(plugin) } unless errors.empty? @@ -64,9 +68,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.hostmanager.ignore_private_ip = false # config.hostmanager.include_offline = true - config.landrush.enabled = true - config.landrush.tld = 'example.com' - config.landrush.guest_redirect_dns = false + if Vagrant.has_plugin?('landrush') + config.landrush.enabled = true + config.landrush.tld = 'example.com' + config.landrush.guest_redirect_dns = false + end if deployment_type == 'openshift-enterprise' # vagrant-registration