aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-06-01 11:56:57 +0000
committerGerrit Code Review <review@openstack.org>2015-06-01 11:56:57 +0000
commiteaa5eb6a5985c52b484d58e22075b84caf2f2493 (patch)
treec7ec76505b5787dfb476e3791a9644d5fb2916f7 /extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
parentd75067951fbd32e0144550bffcd62ab48e2712ee (diff)
parentc799b2e04ea7e2fb0266484fd435782b5f6d3fbf (diff)
Merge "post-deploy hook for rhel registration"
Diffstat (limited to 'extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration')
-rw-r--r--extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration19
1 files changed, 19 insertions, 0 deletions
diff --git a/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration b/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
new file mode 100644
index 00000000..1e72e0a6
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
@@ -0,0 +1,19 @@
+#!/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.
+ 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