diff --git a/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration b/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration index 79144eef6..21f386f28 100755 --- a/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration +++ b/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration @@ -116,7 +116,7 @@ case "${REG_METHOD:-}" in portal) echo "Registering with options: $sanitized_opts" subscription-manager register $opts - if [ -z "${REG_AUTO_ATTACH:-}" ]; then + if [ -z "${REG_AUTO_ATTACH:-}" -a -z "${REG_ACTIVATION_KEY:-}" ]; then echo "Attaching with options: $attach_opts" subscription-manager attach $attach_opts fi diff --git a/elements/rhel-common/pre-install.d/00-rhel-registration b/elements/rhel-common/pre-install.d/00-rhel-registration index 4bfb1a242..dcb69d8f8 100755 --- a/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/elements/rhel-common/pre-install.d/00-rhel-registration @@ -93,7 +93,7 @@ case "${REG_METHOD:-}" in portal) echo "Registering with options: $sanitized_opts" subscription-manager register $opts - if [ -z "${REG_AUTO_ATTACH:-}" ]; then + if [ -z "${REG_AUTO_ATTACH:-}" -a -z "${REG_ACTIVATION_KEY:-}" ]; then echo "Attaching with options: $attach_opts" subscription-manager attach $attach_opts fi