Add throwing error when specifying unsupported os in Vagrant (#9965)

pull/9971/head
Xingjian Zhang 2023-04-11 14:43:18 +08:00 committed by GitHub
parent 0104396c50
commit 6c30b3f263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

7
Vagrantfile vendored
View File

@ -83,6 +83,13 @@ $playbook ||= "cluster.yml"
host_vars = {}
# throw error if os is not supported
if ! SUPPORTED_OS.key?($os)
puts "Unsupported OS: #{$os}"
puts "Supported OS are: #{SUPPORTED_OS.keys.join(', ')}"
exit 1
end
$box = SUPPORTED_OS[$os][:box]
# if $inventory is not set, try to use example
$inventory = "inventory/sample" if ! $inventory