ansible.builtin.redhat_subscription (v2.3.3.0-1) — module

Manage registration and subscriptions to RHSM using the C(subscription-manager) command

| "added in version" 1.2 of ansible.builtin"

Authors: Barnaby Court (@barnabycourt)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.3.0.post1

Description

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


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
    org_id: 222333444
    pool: '^(Red Hat Enterprise Server|Red Hat Virtualization)$'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update the consumed subscriptions from the previous example (remove the Red
# Hat Virtualization subscription)
- redhat_subscription:
    state: present
    activationkey: 1-222333444
    org_id: 222333444
    pool: '^Red Hat Enterprise Server$'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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: yes

Inputs

    
pool:
    default: ^$
    description:
    - Specify a subscription pool name to consume.  Regular expressions accepted.
    required: false

state:
    choices:
    - present
    - absent
    default: present
    description:
    - whether to register and subscribe (C(present)), or unregister (C(absent)) a system
    required: false

org_id:
    default: null
    description:
    - Organization ID to use in conjunction with activationkey
    required: false
    version_added: '2.0'
    version_added_collection: ansible.builtin

password:
    default: null
    description:
    - access.redhat.com or Sat6 password
    required: false

username:
    default: null
    description:
    - access.redhat.com or Sat6  username
    required: false

consumer_id:
    default: null
    description:
    - '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.

      '
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin

environment:
    default: null
    description:
    - Register with a specific environment in the destination org. Used with Red Hat Satellite
      6.x or Katello
    required: false
    version_added: '2.2'
    version_added_collection: ansible.builtin

rhsm_baseurl:
    default: Current value from C(/etc/rhsm/rhsm.conf) is the default
    description:
    - Specify CDN baseurl
    required: false

activationkey:
    default: null
    description:
    - supply an activation key for use with registration
    required: false

autosubscribe:
    default: false
    description:
    - Upon successful registration, auto-consume available subscriptions
    required: false

consumer_name:
    default: null
    description:
    - Name of the system to register, defaults to the hostname
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin

consumer_type:
    default: null
    description:
    - The type of unit to register, defaults to system
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin

force_register:
    default: false
    description:
    - Register the system even if it is already registered
    required: false
    version_added: '2.2'
    version_added_collection: ansible.builtin

server_hostname:
    default: Current value from C(/etc/rhsm/rhsm.conf) is the default
    description:
    - Specify an alternative Red Hat Subscription Management or Sat6 server
    required: false

server_insecure:
    default: Current value from C(/etc/rhsm/rhsm.conf) is the default
    description:
    - Enable or disable https server certificate verification when connecting to C(server_hostname)
    required: false