Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DESCRIPTION OF PROBLEM:
- Unable to register the RHEL 6 host using new Satellite Server Token Registration Steps
Version-Release number of selected component (if applicable):
- Satellite 6.9.5
HOW TO REPRODUCE:
- Create Token from Satellite WEBUI and try to register
# curl --insecure -X GET "https://satellite.example.com:9090/register?activation_key=test&hostgroup_id=2&location_id=2&operatingsystem_id=6&organization_id=1&setup_insights=false&setup_remote_execution=false" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MzIwOTk5NTIsImp0aSI6IjVkODFkZjc2NTcxYjEzNjgyY2QzMTk3MzhlNzljMTljMzY2NWNiZWU3YTg2OTAxOTAzODFkYjRjMTZmYTYwZGQiLCJleHAiOjE2MzIxMTQzNTJ9.XBICWN-Ut3Yc6n3AoGCBizeX2791kh8isqxZSiCc43Y' | bash
ACTUAL RESULT:
- Blank host profile is getting created on Red Hat Satellite WEBUI.
- Host is not getting registered in actual
EXPECTED RESULT:
- Host should get register with the Red Hat Satellite server.
ADDITIONAL INFORMATION:
- After reviewing the background script it is looking for file /etc/os-release and pulling the ID from it
+++++++
if ! [ $(id -u) = 0 ]; then
echo "Please run as root"
exit 1
fi
if [ -f /etc/os-release ] ; then
. /etc/os-release
fi
if [ x$ID = xrhel ] || [ x$ID = xcentos ]; then
register_katello_host(){
UUID=$(subscription-manager identity | head -1 | awk '{print $3}')
curl --cacert $SSL_CA_CERT --request POST "https://susalvi-rhsat.syslab.pnq2.redhat.com:9090/register" \
--data "uuid=$UUID" \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MzIxMDY3OTksImp0aSI6ImU3NTI2N2U1OGU4OGVkZjc4ZTViNzdjODcyNThiNjk3MGY4ZGQ2N2RhNmQxZjExNjM4ZTk5Y2ZmYzdhNjIxNmEiLCJleHAiOjE2MzIxMjExOTl9.kqpnGBJBFarmR6WBAQVrGdpGTg59jGA0tR3LsnR6V0U' \
--data "host[organization_id]=1" --data "host[location_id]=2" --data "host[hostgroup_id]=2" --data "setup_insights=false" --data "setup_remote_execution=false"
}
CONSUMER_RPM=$(mktemp --suffix .rpm)
curl --output $CONSUMER_RPM http://susalvi-rhsat.syslab.pnq2.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
yum localinstall $CONSUMER_RPM -y
rm -f $CONSUMER_RPM
subscription-manager register --org='RedHat' --activationkey='test' || exit 1
register_katello_host | bash
else
register_host | bash
- Since the/etc/os-release file is not present on the RHEL 6 host, it is only creating the blank host profile and skipping the actual registration part.
WORKAROUND -
- Manually create the file "/etc/os-release" with the below details.
++++++++
NAME="Red Hat Enterprise Linux Server"
VERSION="6.10 (Santiago)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="6.10"
++++++++
- Now execute the below curl command and it will register the host successfully.
# curl --insecure -X GET "https://satellite.example.com:9090/register?activation_key=test&hostgroup_id=2&location_id=2&operatingsystem_id=6&organization_id=1&setup_insights=false&setup_remote_execution=false" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MzIwOTk5NTIsImp0aSI6IjVkODFkZjc2NTcxYjEzNjgyY2QzMTk3MzhlNzljMTljMzY2NWNiZWU3YTg2OTAxOTAzODFkYjRjMTZmYTYwZGQiLCJleHAiOjE2MzIxMTQzNTJ9.XBICWN-Ut3Yc6n3AoGCBizeX2791kh8isqxZSiCc43Y' | bash
Hi,
this is expected behavior, we rely on /etc/os-release file,
for systems that doesn't have this file we register machine with minimal data.
Anyway this issue should be fixed in https://github.com/theforeman/foreman/pull/8774,
where we use `/etc/redhat-release` instead of `/etc/os-release`.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:4702