My deployment is not connected to the internet. Where do I put my gemrc
file to specify a local gem repository for Puppet?
Version and installation information
PE version: 5.0 and later
Installation type: Standard
Solution
Sometimes gems need to be installed on agents, sometimes on the master, and sometimes both. Since puppetserver
is a JVM, sometimes the gem needs to be installed into the puppetserver
JVM. With that in mind, we have steps for each of these contexts.
To use gemrc
on Puppet agents and/or the Puppet master
Complete these steps on all agents that install gems from an internal gem repo. If you need external network access, you might want to set a proxy server up.
The configuration file for customizing management and installation of gems used with Puppet is /opt/puppetlabs/puppet/etc/gemrc
. This directory does not exist by default, so you must create it.
-
Create the directory:
mkdir /opt/puppetlabs/puppet/etc/
-
Copy your
gemrc
file to the directory:cp <YOUR GEMRC FILE> /opt/puppetlabs/puppet/etc/gemrc
-
Verify your configuration change by running:
/opt/puppetlabs/puppet/bin/gem environment
To use gemrc
in the puppetserver
JVM
To use gemrc
with the puppetserver
command, you must install the .gemrc
in the home directory of the user executing the puppetserver
command on the master. We suggest that you add the .gemrc
to both the root and puppet user for consistency.
Copy the .gemrc
to the appropriate directory as needed, for example:
-
For the
puppet
user:cp <YOUR GEMRC FILE> ~puppet/.gemrc
-
For the
root
user:cp <YOUR GEMRC FILE> /root/.gemrc
Comments
0 comments
Please sign in to leave a comment.