diff --git a/environments/lifecycle/upgrade-converge.yaml b/environments/lifecycle/upgrade-converge.yaml index 1e6b673208..187893fc69 100644 --- a/environments/lifecycle/upgrade-converge.yaml +++ b/environments/lifecycle/upgrade-converge.yaml @@ -11,3 +11,7 @@ parameter_defaults: UpgradeInitCommonCommand: '' UpgradeInitCommand: '' UpgradeRemoveUnusedPackages: false + # Unset RHEL registration parameters to avoid + # re-registering on future stack updates. + RHELRegistrationActions: 'CREATE' + rhel_reg_force: "" diff --git a/environments/lifecycle/upgrade-prepare.yaml b/environments/lifecycle/upgrade-prepare.yaml index 46278eafa9..8238d3e33d 100644 --- a/environments/lifecycle/upgrade-prepare.yaml +++ b/environments/lifecycle/upgrade-prepare.yaml @@ -21,3 +21,7 @@ parameter_defaults: # Remove the element os-net-config config.json https://bugs.launchpad.net/tripleo/+bug/1758161/ rm /usr/libexec/os-apply-config/templates/etc/os-net-config/config.json || true UpgradeRemoveUnusedPackages: false + # Add RHEL Registration force to re-register with the new key and repos + # also modify the actions to run the resource on stack UPDATE + RHELRegistrationActions: ['CREATE', 'UPDATE'] + rhel_reg_force: "True" diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration index 309dfca100..8148697d7e 100644 --- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration +++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration @@ -7,7 +7,7 @@ set -o pipefail OK=/mnt/state/var/lib/rhsm/rhsm.ok -if [ -e $OK ] ; then +if [ -e $OK -a -z "${REG_FORCE:-}" ] ; then exit 0 fi