How to register a system with Red Hat Subscription-Manager with Ansible?

I'm going to show you a live Playbook and some simple Ansible code.

I'm Luca Berton and welcome to today's episode of Ansible Pilot.

Ansible register a system with Red Hat Subscription-Manager

  • community.general.redhat_subscription
  • Manage registration and subscriptions to RHSM using the subscription-manager command

Today we're talking about the Ansible module redhat_subscription.

The full name is community.general.redhat_subscription, which means that is part of the collection community.general maintained by the Ansible community

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

This module is specific for RedHat Enterprise Linux.

Parameters

  • state _string_ - present/absent
  • username _string_ - access.redhat.com or Satellite 6 username
  • password _string_ - access.redhat.com or Satellite 6 password
  • auto_attach _boolean_ - no/yes auto-consume available subscriptions
  • pool_id _list_ - subscription pool IDs to consume