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.

Bug 2170829

Summary: The hammer\API way to generate host registration command is missing the insecure flag in Capsule installation guide
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: DocumentationAssignee: Malhar Jivrajani <mjivraja>
Documentation sub component: default QA Contact:
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: medium    
Priority: medium CC: mjivraja
Version: 6.13.0Keywords: Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-11 05:29:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sayan Das 2023-02-17 10:40:21 UTC
Document URL: 

https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.13/html-single/installing_capsule_server/index?lb_target=preview

Section Number and Name: 

Chapter 2. Installing Capsule Server

2.1. Registering to Satellite Server

Procedure
  --> CLI Procedure
  --> API Procedure

Describe the issue: 

We mention this :

##############

CLI procedure

Generate the host registration command using the Hammer CLI:

# hammer host-registration generate-command \
--activation-keys "My_Activation_Key"

Connect to your host using SSH and run the registration command.

Check the /etc/yum.repos.d/redhat.repo file and ensure that the appropriate repositories have been enabled.

API procedure

Generate the host registration command using the Satellite API:

# curl -X POST https://satellite.example.com/api/registration_commands \
--user "My_User_Name" \
-H 'Content-Type: application/json' \
-d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"] }}'


############


Both commands will work fine but The registration-command in the resulting output, cannot be executed on capsule to register it back to satellite. 

To rephrase my statement, The command is correct but missing the "insecure" option and without that, It will fail with error :

~~
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above. 
~~

Suggestions for improvement: 

Either,

Improve the hammer command to be :

# hammer host-registration generate-command \
--activation-keys "My_Activation_Key" \
--insecure 1

and Improve the API to be :

# curl -X POST https://satellite.example.com/api/registration_commands \
--user "My_User_Name" \
-H 'Content-Type: application/json' \
-d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"], "insecure": "true" }}'


Or,

Mention a note that, User may additionally need to use --insecure flag while running the resulting registration command


Additional information: 

Please also check 6.11 and 6.12 docs if we need fixing there as well.