Install gems (optional)
In some cases, you might have to install Puppet or Facter gems. For example, if you plan to develop modules, you must install gems. Gems are accessed from a protected repository that requires authentication.
Gems are available from the following protected repository:
https://rubygems-puppetcore.puppet.com
To access gems, you must configure your credentials as environment variables. Then, you can use the Gem client or the Bundle client to install the gems.
On this page:
Prerequisites
These prerequisites apply regardless of whether you use the Gem client or the Bundle client.
Configure your credentials as environment variables, where:
<USERNAME> is a string literal, either forge-key or license-id.
<PASSWORD> is either the API key generated in Puppet Forge associated with your Puppet Core user (if you use forge-key) or your Puppet Enterprise (PE) License ID (if you use license-id). For more information about the API key, see Purchasing Puppet Core and Accessing Puppet Core for limited use for testing or development. You can find your PE License ID in your PE license file or in the PE console by selecting License from the navigation bar.
For example:
export USERNAME=forge-key
export PASSWORD="<API_KEY>"
Install gems with the Gem client
With the Gem client, you can use the following installation procedure.
To configure the new gem source globally and then install the gem, complete the following steps:
-
In the
~/.gemrcfile, add thepuppetcoresource and credentials, where <API_KEY> is the key that you obtained from Puppet Forge, as described in Accessing Puppet Core for limited use for testing or development:Copy:sources:
- "https://forge-key:"<API_KEY>"@rubygems-puppetcore.puppet.com"
- "https://rubygems.org" -
Install gems by following your typical process, for example:
Copygem install puppet
Install gems with the Bundle client
With the Bundle client, you must add the Bundler configuration to download gems from the protected repository. Bundler can then authenticate during the download process.
Complete the following steps:
-
Run the following command:
Copybundle config set --global https://rubygems-puppetcore.puppet.com "$USERNAME:$PASSWORD" -
Specify the gem source block in the Gemfile:
Copysource "https://rubygems-puppetcore.puppet.com" do
gem 'puppet'
end -
To access the protected repository and install the gem, run the following command:
Copybundle install