Fix for passing user defined value for satellite cert for rhel-common.

For 'satellite' mode of registration, rpm for rhel SSL certificate is
hard coded to 'katello-ca-consumer-latest.noarch.rpm'. This commit adds
functionality that provides an option to set this as defined in their
satellite server.

Change-Id: Ib176cfa209f5ac8a4b5da71419327b4237330904
Closes-Bug: 1749947
This commit is contained in:
Anshul Jain 2018-02-22 21:54:52 -06:00
parent e4c2b379ee
commit b37a1e27cb
3 changed files with 9 additions and 2 deletions

View file

@ -210,6 +210,10 @@ Heat metadata can be used to configure the rhel-common element.
# system with the Red Hat Customer Portal. Use "satellite" to
# register a system with Red Hat Satellite 6. Use "disable" to
# skip the registration process.
satellite_cert:
# Defines the ssl certificate to be installed when using "satellite"
# as register mechanism. Default values of this is
# "katello-ca-consumer-latest.noarch.rpm".
Configuration Registration Examples
------------------------------------

View file

@ -23,6 +23,7 @@ REG_POOL_ID="$(os-apply-config --key rh_registration.poolid --type raw --key-def
REG_RELEASE="$(os-apply-config --key rh_registration.release --type raw --key-default '')"
REG_REPOS="$(os-apply-config --key rh_registration.repos --type raw --key-default '')"
REG_SAT_URL="$(os-apply-config --key rh_registration.satellite_url --type raw --key-default '')"
REG_SAT_CERT="$(os-apply-config --key rh_registration.satellite_cert --type raw --key-default '')"
REG_SERVER_URL="$(os-apply-config --key rh_registration.server_url --type raw --key-default '')"
REG_SERVICE_LEVEL="$(os-apply-config --key rh_registration.service_level --type raw --key-default '')"
REG_USER="$(os-apply-config --key rh_registration.user --type raw --key-default '')"
@ -33,6 +34,7 @@ opts=
attach_opts=
repos="repos --enable rhel-7-server-rpms"
satellite_repo="rhel-7-server-rh-common-rpms"
REG_SAT_CERT=${REG_SAT_CERT:-"katello-ca-consumer-latest.noarch.rpm"}
if [ -n "${REG_AUTO_ATTACH:-}" ]; then
opts="$opts --auto-attach"
@ -128,7 +130,7 @@ case "${REG_METHOD:-}" in
user_repos=$repos
repos="$repos --enable ${satellite_repo}"
echo "Installing satellite dependencies"
rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
rpm -Uvh "$REG_SAT_URL/pub/$REG_SAT_CERT" || true
echo "Registering with options: $sanitized_opts"
subscription-manager register $opts
echo "Disabling all previous repos"

View file

@ -11,6 +11,7 @@ opts=
attach_opts=
repos="repos --enable rhel-7-server-rpms"
satellite_repo="rhel-7-server-rh-common-rpms"
REG_SAT_CERT=${REG_SAT_CERT:-"katello-ca-consumer-latest.noarch.rpm"}
if [ -n "${REG_AUTO_ATTACH:-}" ]; then
opts="$opts --auto-attach"
@ -107,7 +108,7 @@ case "${REG_METHOD:-}" in
user_repos=$repos
repos="$repos --enable ${satellite_repo}"
echo "Installing satellite dependencies"
rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
rpm -Uvh "$REG_SAT_URL/pub/$REG_SAT_CERT" || true
echo "Registering with options: $sanitized_opts"
subscription-manager register $opts
echo "Disabling all previous repos"