Skip to content

Commit 020e837

Browse files
committed
chore(Vagrantfile): add custom logic to revert to CoreOS 647.2.0 for stable channel
1 parent b925ebe commit 020e837

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

Vagrantfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,28 @@ def vm_cpus
5252
end
5353

5454
Vagrant.configure("2") do |config|
55-
# always use Vagrants insecure key
55+
# always use Vagrant's insecure key
5656
config.ssh.insert_key = false
57-
5857
config.vm.box = "coreos-%s" % $update_channel
59-
config.vm.box_version = "= 647.2.0"
60-
config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % $update_channel
58+
59+
# HACK to bypass the limitation of the CoreOS "current" metadata for boxes -
60+
# it only specifies the latest release, so we cannot use it for older releases.
61+
# TODO(carmstrong) we can remove this once we're back to using "specific release or more recent"
62+
if $update_channel == "stable"
63+
config.vm.box_version = "= 647.2.0"
64+
config.vm.box_url = "http://stable.release.core-os.net/amd64-usr/647.2.0/coreos_production_vagrant.json"
65+
else
66+
config.vm.box_version = ">= 681.2.0"
67+
config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % $update_channel
68+
end
6169

6270
["vmware_fusion", "vmware_workstation"].each do |vmware|
6371
config.vm.provider vmware do |v, override|
64-
override.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" % $update_channel
72+
if $update_channel == "stable"
73+
override.vm.box_url = "http://stable.release.core-os.net/amd64-usr/647.2.0/coreos_production_vagrant_vmware_fusion.json" % $update_channel
74+
else
75+
override.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" % $update_channel
76+
end
6577
end
6678
end
6779

0 commit comments

Comments
 (0)