Allow for disabling rhel registration

When using the rhel element, it can be uesful to disable registration.
For instance, if using an internal mirror repository that does not
require registration/authentication.

Change-Id: I42fa34e7f146137e5b1b9c5d7785702311e1dca1
This commit is contained in:
James Slagle 2014-12-09 14:14:53 -05:00 committed by Ryan Brady
parent c597e99f4e
commit 697800987f
3 changed files with 14 additions and 6 deletions

View File

@ -59,7 +59,7 @@ the hostname.
#### REG\_METHOD #### REG\_METHOD
Sets the method of registration. Use "portal" to register a system with the Sets the method of registration. Use "portal" to register a system with the
Red Hat Customer Portal. Use "satellite" to register a system with Red Red Hat Customer Portal. Use "satellite" to register a system with Red
Hat Satellite 6. Hat Satellite 6. Use "disable" to skip the registration process.
#### REG\_ORG #### REG\_ORG
Gives the organization to which to join the system. Gives the organization to which to join the system.
@ -190,7 +190,8 @@ Heat metadata can be used to configure the rhel-common element.
method: method:
# Sets the method of registration. Use "portal" to register a # Sets the method of registration. Use "portal" to register a
# system with the Red Hat Customer Portal. Use "satellite" to # system with the Red Hat Customer Portal. Use "satellite" to
# register a system with Red Hat Satellite 6. # register a system with Red Hat Satellite 6. Use "disable" to
# skip the registration process.
Configuration Registration Examples Configuration Registration Examples
------------------------------------ ------------------------------------

View File

@ -116,7 +116,10 @@ case "${REG_METHOD:-}" in
# beta-rpms repo only needed to support the katello-ca rpm above. # beta-rpms repo only needed to support the katello-ca rpm above.
subscription-manager repos --disable ${satellite_repo} subscription-manager repos --disable ${satellite_repo}
;; ;;
disable)
echo "Disabling RHEL registration"
;;
*) *)
echo "WARNING: only 'portal' and 'satellite' are valid values for REG_METHOD." echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."
exit 0 # keeps the stack from failing if you don't set a value in REG_METHOD exit 0
esac esac

View File

@ -97,7 +97,11 @@ case "${REG_METHOD:-}" in
# beta-rpms repo only needed to support the katello-ca rpm above. # beta-rpms repo only needed to support the katello-ca rpm above.
subscription-manager repos --disable rhel-7-server-rh-common-beta-rpms subscription-manager repos --disable rhel-7-server-rh-common-beta-rpms
;; ;;
disable)
echo "Disabling RHEL registration"
export REG_HALT_UNREGISTER=1 # stops attempt to unregister
;;
*) *)
echo "WARNING: only 'portal' and 'satellite' are valid values for REG_METHOD." echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."
exit 1 # RHEL requires registration, fail image build if REG_Method isn't set exit 1
esac esac