Ansible role to configure Red Hat Subscription Management
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Cédric Jeanneret eefe501923 Update rhsm_disable_container_check default value
Following [1], the right way to disable the feature is to set the env
var value to an empty string.
Until now, whatever the value was (even False), it was enabled, because
the var was in the env.


Change-Id: I54e1452dc4bb6e2e25fa9567335b62b730000e83
10 months ago
defaults Fix Ansible Lint 1 year ago
library Fix Ansible Lint 1 year ago
meta Fix Ansible Lint 1 year ago
tasks Update rhsm_disable_container_check default value 10 months ago
templates Update README, variables, and rhsm.conf.j2 5 years ago
tests Fix Ansible Lint 1 year ago
vars Update rhsm_disable_container_check default value 10 months ago
zuul.d Fix lint and zuul: add publish-to-pypi 4 years ago
.ansible-lint Fix Ansible Lint 1 year ago
.gitignore Add resiliency to subscription management role 5 years ago
.gitreview OpenDev Migration Patch 4 years ago
LICENSE Initial commit 6 years ago Fix Ansible Lint 1 year ago
ansible-requirements.txt Fix Ansible Lint 1 year ago
ansible.cfg Initial commit 6 years ago
requirements.txt Initial commit 6 years ago
setup.cfg setup.cfg: Replace dashes with underscores 2 years ago Fix Ansible Lint 1 year ago
test-requirements.txt Fix CI 2 years ago
tox.ini Fix Ansible Lint 1 year ago

Red Hat Subscription


Manage Red Hat subscriptions and repositories. This role supports registering to Satellite 5, Satellite 6, or the Red Hat Customer Portal.


You will need to have an active Red Hat subscription in order for registration to succeed.

Provide rhsm_username and rhsm_password or rhsm_activation_key. These options are mutually exclusive and providing both will result in a failure. The recommended option is to provide an activation key rather than username and password.

Role Variables

Name Default Value Description
rhsm_method portal Method to use for activation: portal or satellite. If satellite, the role will determine the Satellite Server version and take the appropriate registration actions.
rhsm_username [undefined] Red Hat Portal username.
rhsm_password [undefined] Red Hat Portal password.
rhsm_activation_key [undefined] Red Hat Portal Activation Key.
rhsm_release [undefined] RHEL release version (e.g. 8.1).
rhsm_org_id [undefined] Red Hat Portal Organization Identifier.
rhsm_pool_ids [undefined] Red Hat Subscription pool IDs to consume.
rhsm_state present Whether to enable or disable a Red Hat subscription.
rhsm_autosubscribe [undefined] Whether or not to autosubscribe to available repositories.
rhsm_consumer_hostname [undefined] Name of the system to use when registering. Defaults to using the system hostname if undefined.
rhsm_force_register False Whether or not to force registration.
rhsm_repos [] The list of repositories to enable or disable.
rhsm_repos_state [undefined] The state of all repos in rhsm_repos. The module default is enabled.
rhsm_repos_purge [undefined] Whether or not to disable repos not specified in rhsm_repos. The module default is False.
rhsm_rhsm_port 443 Port to use when connecting to subscription server. Must be 8443 if a capsule is used otherwise 443 for Satellite or RHN.
rhsm_server_hostname FQDN of subscription server.
rhsm_server_prefix /subscription or /rhsm RHS server prefix. /subscription when using registering via portal, /rhsm when registering via satellite.
rhsm_insecure False Disable certificate validation.
rhsm_simplified_content_access False Enable Simplified Content Access.
rhsm_ssl_verify_depth 3 Depths certificates should be validated when checking.
rhsm_rhsm_proxy_proto [undefined] protocol used to reach the proxy server (http or https).
rhsm_rhsm_proxy_hostname [undefined] FQDN of outbound proxy server.
rhsm_rhsm_proxy_port [undefined] Port to use for proxy server.
rhsm_rhsm_proxy_user [undefined] Username to use for proxy server.
rhsm_rhsm_proxy_password [undefined] Password to use for proxy server. Save this in an Ansible Vault or other secret store.
rhsm_baseurl Base URL for content.
rhsm_satellite_url [see defaults/main.yml] URL of the Satellite server that will be probed to determine the Satellite version. Uses the scheme and hostname of rhsm_baseurl by default.
rhsm_ca_cert_dir /etc/rhsm/ca/ Server CA certificate directory.
rhsm_product_cert_dir /etc/pki/product Product certificate directory.
rhsm_entitlement_cert_dir /etc/pki/entitlement Entitlement certificate directory.
rhsm_consumer_cert_dir /etc/pki/consumer Consumer certificate directory.
rhsm_manage_repos True Manage generation of yum repositories for subscribed content.
rhsm_full_refresh_on_yum False Refresh repo files with server overrides on every yum command.
rhsm_report_package_profile True Whether to report the package profiles to the subscription management service.
rhsm_plugin_dir /usr/share/rhsm-plugins Directory to search for subscription manage plugins.
rhsm_plugin_conf_dir /etc/rhsm/pluginconf.d Directory to search for plugin configuration files.
rhsm_cert_check_interval 240 Interval in minutes to run certificate check.
rhsm_auto_attach_interval 1440 Interval in minutes to run auto-attach.
rhsm_logging [see defaults/main.yml] Logging settings for various RHSM components.



About repositories

If you are using an activation key with Satellite, the repositories that are associated to the subscription are configured in your local instance of Satellite. You can't specify rhsm_repos parameter if you are using rhsm_activation_key with Satellite. Otherwise, when using Portal registration method you can use either rhsm_username and rhsm_password or activation key and you can use rhsm_repos to select which repos get deployed.

Example Playbook with Red Hat portal


- hosts: all
    rhsm_password: "{{ vault_rhsm_password }}"
      - rhel-7-server-rpms
      - rhel-7-server-extras-rpms
      - rhel-7-server-rh-common-rpms
      - rhel-ha-for-rhel-7-server-rpms
    - openstack.redhat-subscription

Example Playbook with Satellite 6


- hosts: all
    rhsm_activation_key: "secrete_key"
    rhsm_org_id: "Default_Organization"
    rhsm_server_hostname: ""
    rhsm_baseurl: ""
    rhsm_method: satellite
    rhsm_insecure: true
    - openstack.redhat-subscription

Example Playbook to unregister


- hosts: all
    - name: Unregister the node
        name: openstack.redhat-subscription
        tasks_from: unregister


Apache 2.0