Skip to content

Commit

Permalink
Load Vagrant boxes' cloud version based on display name #61
Browse files Browse the repository at this point in the history
  • Loading branch information
gusztavvargadr committed May 29, 2019
1 parent c2eab23 commit 35d02f9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ end

def create_cloud_packer_vm(deployment, name, cloud_name, cloud_version)
VagrantMachine.configure(deployment, 'name' => "#{name}-cloud", 'box' => "gusztavvargadr/#{name}-cloud") do |machine|
VagrantVirtualBoxProvider.configure(machine) do |provider|
provider.override.vm.box_url = "https://vagrantcloud.com/gusztavvargadr/boxes/#{cloud_name}/versions/#{cloud_version}/providers/virtualbox.box"
end
machine.vagrant.vm.box = "gusztavvargadr/#{cloud_name}"
machine.vagrant.vm.box_version = cloud_version

VagrantHyperVProvider.configure(machine) do |provider|
provider.override.vm.box_url = "https://vagrantcloud.com/gusztavvargadr/boxes/#{cloud_name}/versions/#{cloud_version}/providers/hyperv.box"
end
# VagrantVirtualBoxProvider.configure(machine) do |provider|
# provider.override.vm.box_url = "https://vagrantcloud.com/gusztavvargadr/boxes/#{cloud_name}/versions/#{cloud_version}/providers/virtualbox.box"
# end

# VagrantHyperVProvider.configure(machine) do |provider|
# provider.override.vm.box_url = "https://vagrantcloud.com/gusztavvargadr/boxes/#{cloud_name}/versions/#{cloud_version}/providers/hyperv.box"
# end
end
end

0 comments on commit 35d02f9

Please sign in to comment.