vagrant/plugins/provisioners/chef/omnibus.rb
oss-core-libraries-dashboard[bot] ea57f40b89
Some checks failed
/ sync-acceptance (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.1 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.2 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.3 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.4 (push) Has been cancelled
[COMPLIANCE] Update Copyright and License Headers (#13752)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-04 17:07:40 +05:30

40 lines
1.1 KiB
Ruby

# Copyright IBM Corp. 2010, 2025
# SPDX-License-Identifier: BUSL-1.1
module VagrantPlugins
module Chef
# Read more about the Omnibus installer here:
#
# https://docs.chef.io/install_omnibus.html
#
module Omnibus
def sh_command(project, version, channel, omnibus_url, options = {})
command = "curl -sL #{omnibus_url}/install.sh | bash"
command << " -s -- -P \"#{project}\" -c \"#{channel}\""
if version != :latest
command << " -v \"#{version}\""
end
if options[:download_path]
command << " -d \"#{options[:download_path]}\""
end
command
end
module_function :sh_command
def ps_command(project, version, channel, omnibus_url, options = {})
command = ". { iwr -useb #{omnibus_url}/install.ps1 } | iex; install"
command << " -project '#{project}' -channel '#{channel}'"
if version != :latest
command << " -version '#{version}'"
end
command
end
module_function :ps_command
end
end
end