Skip to content

Commit

Permalink
vagrant: Add support for CentOS 8
Browse files Browse the repository at this point in the history
We can now spawn VM on CentOS 8
  • Loading branch information
alexandre-allard committed Dec 21, 2020
1 parent 8037bfa commit 4f873e7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ RHSM_UNREGISTER = 'subscription-manager unregister || true'

EXPORT_KUBECONFIG = 'echo KUBECONFIG=/etc/kubernetes/admin.conf >> /etc/environment'

# To support VirtualBox linked clones
Vagrant.require_version(">= 1.8")
# To support CentOS / RHEL 8, we need at least a version 2.2
# https://github.com/hashicorp/vagrant/commit/ff021fcab404c95e52566bfca4207da9c0101e01
Vagrant.require_version(">= 2.2")

def declare_bootstrap(machine, os_data)
machine.vm.box = os_data[:name]
Expand Down Expand Up @@ -241,6 +242,10 @@ Vagrant.configure("2") do |config|
name: 'centos/7',
version: '1811.02'
},
centos_8: {
name: 'centos/8',
version: '2011.0'
},
ubuntu: {
name: 'ubuntu/bionic64',
version: '20190514.0.0',
Expand Down Expand Up @@ -277,6 +282,7 @@ Vagrant.configure("2") do |config|
}
}


config.vm.box = os_data[:centos][:name]
config.vm.box_version = os_data[:centos][:version]

Expand All @@ -300,6 +306,10 @@ Vagrant.configure("2") do |config|
declare_bootstrap machine, os_data[:centos]
end

config.vm.define :bootstrap_centos_8, autostart: false do |machine|
declare_bootstrap machine, os_data[:centos_8]
end

config.vm.define :bootstrap_ubuntu, autostart: false do |machine|
declare_bootstrap machine, os_data[:ubuntu]
end
Expand All @@ -310,7 +320,7 @@ Vagrant.configure("2") do |config|

os_data.each do |os, os_data|
(1..5).each do |i|
node_name = "#{os}#{i}"
node_name = "#{os}-#{i}"
config.vm.define node_name, autostart: false do |node|

node.vm.box = os_data[:name]
Expand Down

0 comments on commit 4f873e7

Please sign in to comment.