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`.
CP: https://gitlab.sat.engineering.redhat.com/satellite6/foreman/-/merge_requests/607
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