aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/pre_deploy/rhel-registration
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-18 23:14:50 +0000
committerGerrit Code Review <review@openstack.org>2017-08-18 23:14:50 +0000
commitb0559c9db709f14dfccd4d01c27b4ab38daa8b2e (patch)
tree2ae1e6868a4e009068e29e1aec60af272168f843 /extraconfig/pre_deploy/rhel-registration
parenta906f71d8e1254efd46ca0fe499c2750b9bcfaea (diff)
parentd59ba51a1365e897b072c19c40346f0237f62c8b (diff)
Merge "Workaround for RHEL registration as "localhost""
Diffstat (limited to 'extraconfig/pre_deploy/rhel-registration')
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration14
1 files changed, 14 insertions, 0 deletions
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
index d14ed73f..487857ef 100644
--- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
+++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
@@ -235,11 +235,25 @@ case "${REG_METHOD:-}" in
if [ "$satellite_version" = "6" ]; 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"
+
+ # https://bugs.launchpad.net/tripleo/+bug/1711435
+ # Delete the /etc/rhsm/facts directory entirely so that the
+ # %post script from katello-ca-consumer does not override the
+ # hostname with $(hostname -f) if there is no fqdn set
+ fqdn=$(hostname -f)
+ if [ "$fqdn" = "localhost" -o "$fqdn" = "localhost.localdomain" ]; then
+ rm -rf /etc/rhsm/facts
+ fi
+
rpm -Uvh katello-ca-consumer-latest.noarch.rpm || true
retry subscription-manager register $opts
retry subscription-manager $repos
retry yum install -y katello-agent || true # needed for errata reporting to satellite6
katello-package-upload
+
+ # https://bugs.launchpad.net/tripleo/+bug/1711435
+ # recreate the facts dir just in case we rm'd it earlier
+ mkdir -p /etc/rhsm/facts
else
pushd /usr/share/rhn/
curl --retry ${retry_max_count} --retry-delay 10 --max-time 30 -k -O $REG_SAT_URL/pub/RHN-ORG-TRUSTED-SSL-CERT