diskimage-builder/elements/rhel-common/finalise.d/99-unregister
Ryan Brady ac8514c089 Enable RHEL Registration
This patch documents the 00-rhsm script as <= RHEL6 as it doesn't
work with the latest release of Satellite.  The Red Hat Network
(RHN) method of registration is being phased out in favor of Red
Hat Customer Portal and Satellite 6.  The subscription-manager
command line tool is the preferred method of registration.

The registration of RHEL is required to enable repositories for
software installation during image creation time.

This element provides functionality for registering RHEL images
during the image build process with diskimage-builder's
disk-image-create script.  The RHEL image will register itself
with either the hosted Red Hat Customer Portal or Satellite to
enable software installation from official repositories. After
the end of the image creation process, the image will unregister
itself so an entitlement will not be decremented from the account.

Boot-time registration is supported through metadata.  Please see
the configuration in the README for more information.

Change-Id: Ia9ef377cc4ed9595633888bfb248a1224e04b542
2014-10-31 12:36:43 -04:00

17 lines
739 B
Bash
Executable File

#!/bin/bash
set -eux
set -o pipefail
# When building an image with diskimage-builder, you will need to register
# with either the customer portal or a satellite instance in order to enable
# repos for software installation. In most cases, it is desirable to
# unregister a system when diskimage-builder is completing so the customer
# entitlements are not decremented. This option is here for the case when
# a single image needs to be built and deployed as a single instance or for
# debugging purposes so you can check the portal or satellite to see what was
# registered. Set REG_HALT_UNREGISTER to any non-null value to enable this
# functionality.
if [ -z "${REG_HALT_UNREGISTER:-}" ]; then
subscription-manager unregister
fi