Last active
November 12, 2020 11:03
-
-
Save maxlinc/8c64c5e93734a3c939b8 to your computer and use it in GitHub Desktop.
Workaround for Vagrant #2733
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "dummy" | |
config.vm.provider :rackspace do |rs| | |
rs.username = ENV['RAX_USERNAME'] | |
rs.api_key = ENV['RAX_API_KEY'] | |
rs.rackspace_region = :ord | |
end | |
supported_providers = %w(virtualbox rackspace) | |
active_provider = ENV['VAGRANT_ACTIVE_PROVIDER'] # it'd be better to get this from the CLI --provider option | |
supported_providers.each do |provider| | |
next unless active_provider.nil? || active_provider == provider | |
config.vm.define "exact_name_#{provider}" do |box| | |
box.vm.provider :rackspace do |rs| | |
rs.flavor = '1 GB Performance' | |
rs.image = 'Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)' | |
end | |
end | |
config.vm.define "regex_#{provider}" do |box| | |
box.vm.provider :rackspace do |rs| | |
rs.flavor = /1\s+GB\s+Performance/ | |
rs.image = /Ubuntu.*Trusty Tahr.*(PVHVM)/ | |
end | |
end | |
config.vm.define "id_#{provider}" do |box| | |
box.vm.provider :rackspace do |rs| | |
rs.flavor = 'performance1-1' | |
rs.image = 'bb02b1a3-bc77-4d17-ab5b-421d89850fca' | |
end | |
end | |
config.vm.define "unlisted_#{provider}" do |box| | |
box.vm.provider :rackspace do |rs| | |
rs.flavor = 'performance1-1' | |
rs.image = '547a46bd-d913-4bf7-ac35-2f24f25f1b7a' | |
end | |
end | |
end | |
end |
kenorb
commented
Jun 10, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment