2014-10-31 20:06:05 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Chef
|
|
|
|
module Omnibus
|
2014-12-16 17:16:08 +00:00
|
|
|
OMNITRUCK = "https://www.chef.io/chef/install.sh".freeze
|
2014-10-31 20:06:05 +00:00
|
|
|
|
|
|
|
# Read more about the Omnibus installer here:
|
|
|
|
# https://docs.getchef.com/install_omnibus.html
|
|
|
|
def build_command(version, prerelease = false)
|
|
|
|
command = "curl -sL #{OMNITRUCK} | sudo bash"
|
|
|
|
|
|
|
|
if prerelease || version != :latest
|
|
|
|
command << " -s --"
|
|
|
|
end
|
|
|
|
|
|
|
|
if prerelease
|
|
|
|
command << " -p"
|
|
|
|
end
|
|
|
|
|
|
|
|
if version != :latest
|
|
|
|
command << " -v \"#{version}\""
|
|
|
|
end
|
|
|
|
|
|
|
|
command
|
|
|
|
end
|
|
|
|
module_function :build_command
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|