Last active
January 17, 2022 16:34
-
-
Save iversond/e56e608cf8fa65f7160416f4c434da57 to your computer and use it in GitHub Desktop.
For DPK installations on Windows, this script will fix the RubyGems CA issue and add the Puppet-based RubyGems location to `PATH`
This file contains hidden or 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
# Enable RubyGems | |
# | |
# The RubyGems included with the DPK can't download from RubyGems.org due to an oudated SSL Certificate | |
# | |
# invoke-webrequest https://gist.githubusercontent.com/iversond/e56e608cf8fa65f7160416f4c434da57/raw/43902b10b23efac88c58a78c0be66f701cdec4b1/enableRubyGems.ps1; . $env:TEMP\enableRubyGems.ps1 | |
# | |
$puppetGemFolder = Resolve-Path 'C:\Program Files\Puppet Labs\Puppet\sys\ruby\lib\ruby\*\rubygems\ssl_certs\' | |
#Invoke-WebRequest https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem -OutFile $puppetGemFolder\RubyGemsCA.pem | |
Invoke-WebRequest https://github.com/rubygems/rubygems/blob/270f8f9f2ea39d2e35cb1063b88dcee26cfaf070/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem -OutFile $puppetGemFolder\RubyGemsCA.pem | |
$env:PATH+=";C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin" | |
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, "Machine") |
Thanks for the updated URL @daviddickgrcc
Probably should update the gem folder to the new puppet agent folder...
*\psft_puppet_agent\lib\ruby\*\rubygems\ssl_certs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the URL needs to be updated to https://github.com/rubygems/rubygems/blob/270f8f9f2ea39d2e35cb1063b88dcee26cfaf070/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem