tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
James Slagle 3884694d58 Add Satellite 5 support
Add Satellite 5 support to the RHEL registration environment and
resources. The registration script is updated to support both satellite
versions in place given the similarity of the options for both
scenarios.

The satellite version is detected based on $REG_SAT_URL, and that
determines whether subscription-manager or rhnreg_ks is used.

Change-Id: Ic261c8a16a7d6d3978f8bfc6e53f75dbe1b716db
2016-02-29 14:23:36 -05:00

22 lines
612 B
Bash

#!/bin/bash
set -eux
set -o pipefail
case "${REG_METHOD:-}" in
portal|satellite)
# Allow unregistration to fail.
# We don't want to fail stack deletes if unregistration fails.
# Note that this will be a no-op on satellite 5, which doesn't support
# unregistering from the cli.
subscription-manager unregister || true
subscription-manager clean || true
;;
disable)
echo "Disabling RHEL unregistration"
;;
*)
echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."
exit 0
esac