aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-12 08:04:59 +0000
committerGerrit Code Review <review@openstack.org>2015-10-12 08:04:59 +0000
commit9fed7785b036d8d60d35c64e4e0fc29fcb771284 (patch)
tree1463a1b0eceef7d932247da495077bcf68c766cf /extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
parentceaecbd9d9dae2fc32539e85ae42d129f506a02b (diff)
parent2793ab34d244443963b9ad23e7fcefad6cb1ddaa (diff)
Merge "Move RHEL (un)registration to NodeExtraConfig"
Diffstat (limited to 'extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration')
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration19
1 files changed, 19 insertions, 0 deletions
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
new file mode 100644
index 00000000..1e72e0a6
--- /dev/null
+++ b/extraconfig/pre_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