aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/pre_deploy/rhel-registration
diff options
context:
space:
mode:
Diffstat (limited to 'extraconfig/pre_deploy/rhel-registration')
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration17
1 files changed, 8 insertions, 9 deletions
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
index 487857ef..d754aafd 100644
--- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
+++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
@@ -186,14 +186,13 @@ function retry() {
set -e
}
-function detect_satellite_version {
- ping_api=$REG_SAT_URL/katello/api/ping
- if curl --retry ${retry_max_count} --retry-delay 10 --max-time 30 -L -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then
- echo Satellite 6 detected at $REG_SAT_URL
- satellite_version=6
+function detect_satellite_server {
+ if curl --retry ${retry_max_count} --retry-delay 10 --max-time 30 -L -k -s -D - -o /dev/null $REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm | grep "200 OK"; then
+ echo Satellite 6 or beyond with Katello API detected at $REG_SAT_URL
+ katello_api_enabled=1
elif curl --retry ${retry_max_count} --retry-delay 10 --max-time 30 -L -k -s -D - -o /dev/null $REG_SAT_URL/rhn/Login.do | grep "200 OK"; then
- echo Satellite 5 detected at $REG_SAT_URL
- satellite_version=5
+ echo Satellite 5 with RHN detected at $REG_SAT_URL
+ katello_api_enabled=0
else
echo No Satellite detected at $REG_SAT_URL
exit 1
@@ -231,8 +230,8 @@ case "${REG_METHOD:-}" in
retry subscription-manager $repos
;;
satellite)
- detect_satellite_version
- if [ "$satellite_version" = "6" ]; then
+ detect_satellite_server
+ if [ "$katello_api_enabled" = "1" ]; then
repos="$repos --enable ${satellite_repo}"
curl --retry ${retry_max_count} --retry-delay 10 --max-time 30 -L -k -O "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm"