W3cubDocs

/Ansible

redhat_subscription - Manage registration and subscriptions to RHSM using the subscription-manager command

Synopsis

Manage registration and subscription to the Red Hat Subscription Management entitlement platform using the subscription-manager command

Requirements (on host that executes module)

  • subscription-manager

Options

parameter required default choices comments
activationkey
no
supply an activation key for use with registration
autosubscribe
no
Upon successful registration, auto-consume available subscriptions
consumer_id
(added in 2.1)
no
References an existing consumer ID to resume using a previous registration for this system. If the system's identity certificate is lost or corrupted, this option allows it to resume using its previous identity and subscriptions. The default is to not specify a consumer ID so a new ID is created.
consumer_name
(added in 2.1)
no
Name of the system to register, defaults to the hostname
consumer_type
(added in 2.1)
no
The type of unit to register, defaults to system
environment
(added in 2.2)
no
Register with a specific environment in the destination org. Used with Red Hat Satellite 6.x or Katello
force_register
(added in 2.2)
no
Register the system even if it is already registered
org_id
(added in 2.0)
no
Organization ID to use in conjunction with activationkey
password
no
access.redhat.com or Sat6 password
pool
no ^$
Specify a subscription pool name to consume. Regular expressions accepted.
rhsm_baseurl
no Current value from C(/etc/rhsm/rhsm.conf) is the default
Specify CDN baseurl
server_hostname
no Current value from C(/etc/rhsm/rhsm.conf) is the default
Specify an alternative Red Hat Subscription Management or Sat6 server
server_insecure
no Current value from C(/etc/rhsm/rhsm.conf) is the default
Enable or disable https server certificate verification when connecting to server_hostname
state
no present
  • present
  • absent
whether to register and subscribe (present), or unregister (absent) a system
username
no
access.redhat.com or Sat6 username

Examples

# Register as user (joe_user) with password (somepass) and auto-subscribe to available content.
- redhat_subscription: state=present username=joe_user password=somepass autosubscribe=true

# Same as above but with pulling existing system data.
- redhat_subscription: state=present username=joe_user password=somepass
                       consumer_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# Register with activationkey (1-222333444) and consume subscriptions matching
# the names (Red hat Enterprise Server) and (Red Hat Virtualization)
- redhat_subscription: state=present
                       activationkey=1-222333444
                       pool='^(Red Hat Enterprise Server|Red Hat Virtualization)$'

# Update the consumed subscriptions from the previous example (remove the Red
# Hat Virtualization subscription)
- redhat_subscription: state=present
                       activationkey=1-222333444
                       pool='^Red Hat Enterprise Server$'

# Register as user credentials into given environment (against Red Hat
# Satellite 6.x), and auto-subscribe to available content.
- redhat_subscription: state=present
                       username=joe_user password=somepass
                       environment=Library
                       autosubscribe=true

Notes

Note

In order to register a system, subscription-manager requires either a username and password, or an activationkey.

This is a Core Module

For more information on what this means please read Core Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/redhat_subscription_module.html