RETIRED, Ansible role to configure Red Hat Subscription Management
Go to file
Emilien Macchi a0c7cfffcc Fix defaults when activation key is used, add options
When the activation key is used, we don't want to deploy repositories,
and also it's not compatible with autosubscribe option, they are both
mutually exclusive.

This patch:
- change the default of rhsm_autosubscribe to be undefined.
- configure repositories when activationkey isn't defined.
- use include_tasks since a variable is in the task file name
- add option to force registration
- pass the rhsm_baseurl to the registration task, which is needed when
  unregistering
- derive the rhsm_satellite_url from rhsm_baseurl by default, but allow it to
  be overridden
- sets validate_certs for yum tasks
- uses dynamic task inclusion rather than static import with a default filter for selecting the registration method

Change-Id: Ibf8c3c573a78acc6815cf3793a208028c43f3ba1
Closes-Bug: #1798382
2018-10-17 17:29:06 -04:00
ci-scripts Initial commit 2017-12-13 20:53:08 +00:00
defaults Fix defaults when activation key is used, add options 2018-10-17 17:29:06 -04:00
library Update RHSM role to allow Satellite or Portal registration 2018-02-07 16:53:01 -05:00
meta Fix defaults when activation key is used, add options 2018-10-17 17:29:06 -04:00
tasks Fix defaults when activation key is used, add options 2018-10-17 17:29:06 -04:00
templates Update README, variables, and rhsm.conf.j2 2018-02-20 16:52:33 -05:00
tests Update README, variables, and rhsm.conf.j2 2018-02-20 16:52:33 -05:00
zuul.d Remove release-openstack-server 2018-09-28 15:28:16 +02:00
.gitignore Initial commit 2017-12-13 20:53:08 +00:00
.gitreview Initial commit 2017-12-13 20:53:08 +00:00
LICENSE Initial commit 2017-12-13 20:53:08 +00:00
README.md Fix defaults when activation key is used, add options 2018-10-17 17:29:06 -04:00
ansible-requirements.txt Initial commit 2017-12-13 20:53:08 +00:00
ansible.cfg Initial commit 2017-12-13 20:53:08 +00:00
requirements.txt Initial commit 2017-12-13 20:53:08 +00:00
setup.cfg Add library/ directory to setup.cfg 2017-12-14 12:42:53 +01:00
setup.py Initial commit 2017-12-13 20:53:08 +00:00
test-requirements.txt Initial commit 2017-12-13 20:53:08 +00:00
tox.ini fix tox python3 overrides 2018-10-08 03:01:45 +00:00

README.md

Red Hat Subscription

Galaxy

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

Requirements

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_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 [undefined] Whether or not to force registration. Will not force registration if undefined.
rhsm_repos [] The list of repositories to enable or disable. See defaults/main.yml for examples.
rhsm_rhsm_port 443 Port to use when connecting to subscription server.
rhsm_server_hostname subscription.rhn.redhat.com FQDN of subscription server.
rhsm_server_prefix /subscription Server prefix
rhsm_insecure False Disable certificate validation.
rhsm_ssl_verify_depth 3 Depths certificates should be validated when checking.
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 https://cdn.redhat.com 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_repo_ca_cert %(ca_cert_dir)sredhat-uep.pem Default CA to use when generating yum rep configs.
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.

Dependencies

None.

Example Playbook

- hosts: all

  vars:
    rhsm_username: bob.smith@acme.com
    rhsm_password: "{{ vault_rhsm_password }}"
    rhsm_repos:
      - name: rhel-7-server-extras-rpms
        state: present
      - rhel-7-server-rh-common-rpms
      - rhel-7-server-openstack-8-rpms

  roles:
     - openstack.redhat-subscription

License

Apache 2.0