Documentation

redhat_subscription - Manage Red Hat Network registration and subscriptions using the subscription-manager command

Synopsis

Manage registration and subscription to the Red Hat Network entitlement platform.

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
      org_id
      (added in 2.0)
      no
        Organisation ID to use in conjunction with activationkey
        password
        no
          Red Hat Network 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 Network 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
                    Red Hat Network 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
                    
                    # 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$'
                    

                    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, Helping Testing PRs and Developing Modules.