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

Select Status

The redhat_subscription_manager cookbook has been deprecated

Author provided reason for deprecation:

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.

RSS

redhat_subscription_manager (15) Versions 1.0.4

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

Policyfile
Berkshelf
Knife
cookbook 'redhat_subscription_manager', '~> 1.0.4', :supermarket
cookbook 'redhat_subscription_manager', '~> 1.0.4'
knife supermarket install redhat_subscription_manager
knife supermarket download redhat_subscription_manager
README
Dependencies
Changelog
Quality 17%

The resources in this cookbook now ship as part of Chef 14. This cookbook is now deprecated and no further updates will be made. We highly recommend you update to Chef 14 and submit and issues you find to the Chef github repo at https://github.com/chef/chef

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.

Scope

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.

Requirements

  • Chef 12.7+
  • 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

Usage

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

depends 'redhat_subscription_manager'

Then, in a recipe:

rhsm_register 'myhost' do
  activation_key 'mykey1234'
  satellite_host 'satellite.mycompany.com'
  action :register
end

Resources

rhsm_register

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

Actions

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

Properties

  • 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.
  • install_katello_agent: if true, the katello-agent RPM will be installed. Defaults to true
  • sensitive: if true, the execution of the registration command will be flagged as "sensitive," prohibiting the command, STDOUT, and STDERR from being displayed in the Chef log output. This command could contain usernames, passwords, and activation keys, so unlike other Chef resources, this defaults to true. However, you may set it to false to get additional output if your registration attempts are failing.
  • force: if true, the system will be registered even if it is already registered. Normally, any register operations will fail if the machine is has already registered.

Examples

rhsm_register 'myhost' do
  satellite_host 'satellite.mycompany.com'
  activation_key [ 'key1', 'key2' ]
end

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

rhsm_register 'myhost' do
  action :unregister
end

rhsm_subscription

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.

Actions

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

Properties

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

Examples

rhsm_subscription 'pool123' do
  action :attach
end

rhsm_subscription 'pool321' do
  action :remove
end

rhsm_repo

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

Actions

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

Properties

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

Examples

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

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

rhsm_errata

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.

Actions

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

Properties

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

Examples

rhsm_errata 'RHSA:2015-1234'

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

rhsm_errata_level

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.

Actions

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

Properties

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.

Examples

rhsm_errata_level 'critical'

rhsm_errata_level 'IMPORTANT' do
  action :install
end

Attributes

  • node['rhsm']['lang'] - Sets the environment language with that subscription-manager commands are executed. The output of that command is localized and non English output breaks the output parsing of this cookbook. Therefore changing the default may break this cookbook. Defaults to 'en_US'.

License and Authors

Author:: Chef Partner Engineering (partnereng@chef.io)

Copyright:: 2015-2018 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

http://www.apache.org/licenses/LICENSE-2.0

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.

Contributing

  1. Fork it ( https://github.com/chef-partners/redhat-subscription-manager-cookbook/fork )
  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

redhat_subscription_manager Cookbook CHANGELOG

This file is used to list changes made in each version of the redhat_subscription_manager cookbook.

1.0.3 (2018-04-06)

  • The resources in this cookbook now ship as part of Chef 14. This cookbook is now deprecated and no further updates will be made. We highly recommend you update to Chef 14 and submit and issues you find to the Chef github repo at https://github.com/chef/chef

1.0.3 (2018-04-05)

  • Fix username/password based registration

1.0.2 (2018-02-14)

  • Fix only_if for katello-agent install in the register resource
  • Update disable action text for the execute resource in the repo resource
  • Updated the register resource to install subscription-manager which may be missing
  • Simplified logic around activation_key property in the register resource
  • Added native property validation to errata_level property in errata_level resource

1.0.1 (2018-02-06)

  • Resolve a Chef 14 deprecation warning in rhsm_subscription resource

1.0.0 (2018-01-29)

  • Removed the dependency on the compat_resource cookbook and instead require Chef 12.7 or later. This also fixes issues with running this cookbook on more recent Chef releases where compat_resource is no longer functional.
  • Resolved multiple Chef 14 deprecation errors
  • Don't try to install the katello package unless we've specified a sat host. This fixes using the public sat endpoint
  • Skip all the katello agent download logic not just the remote file. This cleans up logs and speeds up Chef runs.
  • Added redhat as a supported platform in the metadata
  • Updated license strings to be SPDX compatible license strings
  • Updated testing to use ChefDK and Delivery local mode. Gemfile / Rake testing has been removed
  • Remove sensitive properly from the resource that wasn't necessary with Chef 12+
  • Removed the ChefSpec matchers as these are autogenerated now by ChefSpec in current DK releases.
  • Added contributing, testing, and license files
  • Converted integration testing to inspec

v0.7.0

Full Changelog

Closed issues:

  • Registration fails in non-English environments #32

Merged pull requests:

  • override languages in environment when running commands #33 (kleini)

v0.6.1 (2017-10-24)

Full Changelog

Closed issues:

  • Expose "name" attribute for "--name" argument of subscription-manager #26
  • Kattello Agent install fails because the repo isn't registered yet #25

Merged pull requests:

v0.6.0 (2017-04-24)

Full Changelog

Merged pull requests:

  • add force registration option #24 (bcg62)

v0.5.0 (2016-03-02)

Full Changelog

Closed issues:

  • Applying critical errata sometimes fails #16

Merged pull requests:

v0.4.0 (2016-02-17)

Full Changelog

Closed issues:

  • Error running in RHEL7 #12
  • When registering with username/password - passwords w/ '&' in them fail #10
  • When registering to Redhat's RHSM with u/p - environment not supported #9

Merged pull requests:

  • Don't pull and install a katello cert if it's already installed. #17 (adamleff)
  • fixing travis notifications #15 (adamleff)
  • Fixing auto-attach scope, and making sensitivity configurable #14 (adamleff)
  • Correcting environment parameter usage during registration #11 (adamleff)

v0.3.0 (2016-01-22)

Full Changelog

Closed issues:

  • Errata Install Doesn't Work On RHEL6 #7
  • Require yum-plugin-security to be installed #5

v0.2.0 (2015-12-21)

Full Changelog

Closed issues:

  • Guard katello-agent install? #3

Merged pull requests:

  • Adding ability to not install katello-agent #4 (adamleff)

v0.1.1 (2015-11-24)

Full Changelog

Merged pull requests:

  • Using file_cache_path instead of /tmp to satisfy FC013 #2 (adamleff)

v0.1.0 (2015-11-24)

Merged pull requests:

Collaborator Number Metric
            

1.0.4 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

1.0.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Cookstyle Metric
            

1.0.4 failed this metric

Chef/Deprecations/ResourceUsesOnlyResourceName: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourceusesonlyresourcename): redhat_subscription_manager/libraries/rhsm_errata.rb: 21
Chef/Deprecations/ResourceUsesOnlyResourceName: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourceusesonlyresourcename): redhat_subscription_manager/libraries/rhsm_errata_level.rb: 21
Chef/Deprecations/ResourceUsesOnlyResourceName: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourceusesonlyresourcename): redhat_subscription_manager/libraries/rhsm_register.rb: 21
Chef/Deprecations/ResourceUsesOnlyResourceName: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourceusesonlyresourcename): redhat_subscription_manager/libraries/rhsm_repo.rb: 21
Chef/Deprecations/ResourceUsesOnlyResourceName: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourceusesonlyresourcename): redhat_subscription_manager/libraries/rhsm_subscription.rb: 21

Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations

No Binaries Metric
            

1.0.4 passed this metric

Testing File Metric
            

1.0.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

1.0.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number