2014-10-31 20:06:05 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Chef
|
2015-11-19 23:01:09 +00:00
|
|
|
# Read more about the Omnibus installer here:
|
|
|
|
#
|
|
|
|
# https://docs.chef.io/install_omnibus.html
|
|
|
|
#
|
2014-10-31 20:06:05 +00:00
|
|
|
module Omnibus
|
2017-06-14 10:34:52 +00:00
|
|
|
def sh_command(project, version, channel, omnibus_url, options = {})
|
|
|
|
command = "curl -sL #{omnibus_url}/install.sh | bash"
|
2015-11-19 23:01:09 +00:00
|
|
|
command << " -s -- -P \"#{project}\" -c \"#{channel}\""
|
2014-10-31 20:06:05 +00:00
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
if version != :latest
|
|
|
|
command << " -v \"#{version}\""
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
if options[:download_path]
|
|
|
|
command << " -d \"#{options[:download_path]}\""
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
command
|
|
|
|
end
|
|
|
|
module_function :sh_command
|
2014-10-31 20:06:05 +00:00
|
|
|
|
2017-06-14 10:34:52 +00:00
|
|
|
def ps_command(project, version, channel, omnibus_url, options = {})
|
|
|
|
command = ". { iwr -useb #{omnibus_url}/install.ps1 } | iex; install"
|
2015-11-19 23:01:09 +00:00
|
|
|
command << " -project '#{project}' -channel '#{channel}'"
|
|
|
|
|
|
|
|
if version != :latest
|
|
|
|
command << " -version '#{version}'"
|
2014-12-16 22:29:47 +00:00
|
|
|
end
|
|
|
|
|
2014-10-31 20:06:05 +00:00
|
|
|
command
|
|
|
|
end
|
2015-11-19 23:01:09 +00:00
|
|
|
module_function :ps_command
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|