Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

The redhat_subscription_manager cookbook has been deprecated

The redhat_subscription_manager cookbook has been deprecated and is no longer being maintained by its authors. Use of the redhat_subscription_manager cookbook is no longer recommended.


redhat_subscription_manager (15) Versions 0.1.0

Provides custom resources to interact with Red Hat Subscription Manager (RHSM) and Red Hat Satellite

cookbook 'redhat_subscription_manager', '= 0.1.0'
cookbook 'redhat_subscription_manager', '= 0.1.0', :supermarket
knife supermarket install redhat_subscription_manager
knife supermarket download redhat_subscription_manager
Quality 0%

redhat_subscription_manager cookbook

The Red Hat Subscription Manager (RHSM) cookbook provides custom resources for use in recipes to interact with RHSM or a locally-installed Red Hat Satellite. These resources allow you to configure your hosts' registration status, repo status, and installation of errata.


This cookbook focuses on Red Hat Enterprise Linux hosts with support for the subscription-manager tool and the new style of registration and subscription management. It does not support the former rhn_register or spacewalk-channel method of channel registration.


  • Chef 12.0.0 or higher
  • Outbound internet access (if not using a locally-accessible Satellite)
  • Outbound access to the Satellite host (if using a Satellite)
  • Valid Red Hat entitlements/subscriptions


Place a dependency on the redhat_subscription_manager cookbook in your cookbook's metadata.rb:

depends 'redhat_subscription_manager', '~> 0.1'

Then, in a recipe:

rhsm_register 'myhost' do
  activation_key 'mykey1234'
  satellite_host ''
  action :register



The rhsm_register resource performs the necessary tasks to register your host with RHSM or your local Satellite server.


  • :register: (default) registers your host
  • :unregister: unregisters your host


  • activation_key: string of the activation key to use when registering, or an array of keys if multiple keys are needed. When using activation_key, you must supply an organization.
  • satellite_host: (optional) FQDN of the Satellite host to register with. If not specified, the host will be registered with Red Hat's public RHSM service.
  • organization: organization to use when registering, required when using an activation key
  • username: username to use when registering. Not applicable if using an activation key. If specified, password and environment are also required.
  • password: password to use when registering. Not applicable if using an activation key. If specified, username and environment are also required.
  • environment: environment to use when registering, required when using username and password
  • auto_attach: if true, RHSM will attempt to automatically attach the host to applicable subscriptions. It is generally better to use an activation key with the subscriptions pre-defined.


rhsm_register 'myhost' do
  satellite_host ''
  activation_key [ 'key1', 'key2' ]

rhsm_register 'myhost' do
  username 'myuser'
  password 'mypassword'
  environment 'myenvironment'
  auto_attach true

rhsm_register 'myhost' do
  action :unregister


The rhsm_subscription resource will add another subscription to your host. This can be used when a host's activation_key does not attach all necessary subscriptions to your host.


  • :attach: (default) attach a new subscription
  • :remove: remove an existing Subscription


None. The name passed in to the resource will be the pool ID to use when attaching/removing.


rhsm_subscription 'pool123' do
  action :attach

rhsm_subscription 'pool321' do
  action :remove


The rhsm_repo resource enabled and disables repositories that are made available via attached subscriptions.


  • :enable: (default) enable a repo
  • :disable: disable a repo


None. The name passed in to the resource will be the repository name to use when enabling/disabling.


rhsm_repo 'rhel-7-myrepo' do
  action :enable

rhsm_repo 'rhel-7-oldrepo' do
  action :disable


The rhsm_errata resource will ensure packages associated with a given Errata ID are installed. This is helpful if packages to mitigate a single vulnerability must be installed on your hosts.


  • :install: (default) install all packages for a given erratum


None. The name passed in to the resource will be the Errata ID to use when installing packages.


rhsm_errata 'RHSA:2015-1234'

rhsm_errata 'RHSA:2015-4321' do
  action :install


The rhsm_errata_level resource will install all packages for all errata of a certain security level. For example, you can ensure that all packages associated with errata marked at a "Critical" security level are installed.


  • :install: (default) install all packages for all errata of a certain security level


None. The name passed in to the resource will be the security level to use when installing packages.

Valid security levels are: critical, moderate, important, and low. While yum is case sensitive, the values expected by this cookbook are not.


rhsm_errata_level 'critical'

rhsm_errata_level 'IMPORTANT' do
  action :install

License and Authors

Author:: Chef Partner Engineering (

Copyright:: Copyright (c) 2015 Chef Software, Inc.

License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Foodcritic Metric

0.1.0 failed this metric

FC013: Use file_cache_path rather than hard-coding tmp paths: /tmp/cook/8299ff0a5434e9557221de30/redhat_subscription_manager/libraries/rhsm_register.rb:35