Created
March 24, 2017 22:59
-
-
Save baurzhan-konurbayev/19b19205e8d4f2fb9305e36f9055c218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def install_gem(gem_name, gem_source, gem_version, gem_options, gem_compile_time) | |
# Chef::Log.warn("gem_name #{gem_name} gem_version #{gem_version} gem_source #{gem_source}") | |
# Install gem from private gem server | |
res = Chef::Resource::ChefGem.new gem_name, run_context | |
res.clear_sources true | |
res.compile_time gem_compile_time | |
res.options if gem_options | |
res.version gem_version | |
res.source gem_source | |
res.run_action :install | |
# Ensure gem has required version | |
gem gem_name, "=#{gem_version}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment