From c799b2e04ea7e2fb0266484fd435782b5f6d3fbf Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 9 Apr 2015 15:01:08 +0100 Subject: post-deploy hook for rhel registration Adds a potential usage of the post-deploy hooks to register a server with RHN or a satellite. Note this requires some additional parameters, which can be specified in environment_rhel_reg.yaml, and this must be passed into the call to heat via another -e parameter. An alternative may be to have a global extraconfig_env.yaml at the top level, which the scripts always pass, or to use the global environment (/etc/heat/environment.d/default.yaml) on the seed. Co-Authored-By: James Slagle Change-Id: Ia6fd270122cbc2e51beb672654e5e1ebd3bd2966 --- .../rhel-registration/scripts/rhel-unregistration | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration (limited to 'extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration') 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 -- cgit 1.2.3-korg