The blp-gemrc cookbook is a library cookbook that provides a custom resource for configuring the gemrc file for a RubyGems environment.
The following platforms are tested automatically using Test Kitchen, in Docker, with the default suite of integration tests:
- Ubuntu 12.04/14.04/16.04
- CentOS (RHEL) 6/7
Additionally, the platforms below are also known to work:
- AIX 7.1
- Solaris 5.11
- Windows 2008r2/2012r2
The default recipe configures the embedded gem configuration of the Chef Client. This allows for changing the gem sources that would get pulled from during a normal convergence.
Attribute Name | Type | Default Value | Description |
---|---|---|---|
node['gemrc']['config'] |
Hash | gem: '--no-ri --no-rdoc' |
Sets the options for the default recipe gemrc configuration. |
node['gemrc']['sensitive'] |
Boolean | false |
Tells the default recipe whether the gemrc is sensitive (should not be output to Chef log) |
A common use case for this cookbook is to configure the Chef Client's gem environment to an internal mirror if behind the veil of the corporate firewall.
Here is an example of how to use an internal Artifactory instance to mirror the RubyGems.org repository.
node.default['gemrc']['path'] = Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
node.default['gemrc']['reload'] = true
node.default['gemrc']['config']['sources'] = ['http://artifactory.corporate.com/artifactory/api/gems/ruby-gems/']
include_recipe 'gemrc::default'