summaryrefslogtreecommitdiffstats
path: root/extraconfig/pre_deploy
diff options
context:
space:
mode:
Diffstat (limited to 'extraconfig/pre_deploy')
-rw-r--r--extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml1
-rw-r--r--extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml4
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration11
3 files changed, 11 insertions, 5 deletions
diff --git a/extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml b/extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml
index 70437a8a..c388358a 100644
--- a/extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml
+++ b/extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml
@@ -20,3 +20,4 @@ parameter_defaults:
rhel_reg_user: ""
rhel_reg_type: ""
rhel_reg_method: ""
+ rhel_reg_sat_repo: "rhel-7-server-satellite-tools-6.1-rpms"
diff --git a/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml b/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
index a884bdae..7c65bd8b 100644
--- a/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
+++ b/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
@@ -43,6 +43,8 @@ parameters:
type: string
rhel_reg_method:
type: string
+ rhel_reg_sat_repo:
+ type: string
resources:
@@ -68,6 +70,7 @@ resources:
- name: REG_USER
- name: REG_TYPE
- name: REG_METHOD
+ - name: REG_SAT_REPO
config: {get_file: scripts/rhel-registration}
RHELRegistrationDeployment:
@@ -95,6 +98,7 @@ resources:
REG_USER: {get_param: rhel_reg_user}
REG_TYPE: {get_param: rhel_reg_type}
REG_METHOD: {get_param: rhel_reg_method}
+ REG_SAT_REPO: {get_param: rhel_reg_sat_repo}
RHELUnregistration:
type: OS::Heat::SoftwareConfig
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
index 76fa63b4..1c9acd2b 100644
--- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
+++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
@@ -15,7 +15,7 @@ opts=
attach_opts=
sat5_opts=
repos="repos --enable rhel-7-server-rpms"
-satellite_repo="rhel-7-server-rh-common-rpms"
+satellite_repo=${REG_SAT_REPO}
if [ -n "${REG_AUTO_ATTACH:-}" ]; then
opts="$opts --auto-attach"
@@ -98,10 +98,10 @@ fi
function detect_satellite_version {
ping_api=$REG_SAT_URL/katello/api/ping
- if curl -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then
+ if curl -L -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then
echo Satellite 6 detected at $REG_SAT_URL
satellite_version=6
- elif curl -k -s -D - -o /dev/null $REG_SAT_URL/rhn/Login.do | grep "200 OK"; then
+ elif curl -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
else
@@ -120,9 +120,10 @@ case "${REG_METHOD:-}" in
;;
satellite)
detect_satellite_version
- if [ "satellite_version" = "6" ]; then
+ if [ "$satellite_version" = "6" ]; then
repos="$repos --enable ${satellite_repo}"
- rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
+ curl -L -k -O "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm"
+ rpm -Uvh katello-ca-consumer-latest.noarch.rpm || true
subscription-manager register $opts
subscription-manager $repos
yum install -y katello-agent || true # needed for errata reporting to satellite6