Skip to content

Fixes #39119 - Support generating registration command via REST API in isolated networks managed by external capsules#534

Open
lfu wants to merge 1 commit intotheforeman:masterfrom
lfu:37836_reg_cmd_proxy
Open

Fixes #39119 - Support generating registration command via REST API in isolated networks managed by external capsules#534
lfu wants to merge 1 commit intotheforeman:masterfrom
lfu:37836_reg_cmd_proxy

Conversation

@lfu
Copy link

@lfu lfu commented Feb 27, 2026

To be able to generate the registration command for hosts in an isolated network.

Before

$ curl -k -X POST "https://capsule.redhat.com/api/registration_commands" \
  --user "userid:password" \
  -H "Content-Type: application/json" \
  -d '{
    "registration_command": {
      "activation_keys": ["AK1"],
      "insecure": false
    }
  }'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>

Capsule

Apply this fix in /usr/share/foreman-installer/modules/foreman_proxy_content

foreman-installer -l info

After

$ curl -k -X POST "https://capsule.redhat.com/api/registration_commands" \
  --user "userid:password" \
  -H "Content-Type: application/json" \
  -d '{
    "registration_command": {
      "activation_keys": ["AK1"],
      "insecure": false
    }
  }'
{"registration_command":"set -o pipefail \u0026\u0026 curl --silent --show-error   'https://capsule.redhat.com/register?activation_keys=AK1' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozLCJpYXQiOjE3NzIxMzM5NjksImp0aSI6IjYxOTRkMmJjNjY2Mjk0YjQ5YjY4ODFkNTU2YjE3MTRkOWYxOWYyM2VjZjdkNDkwZTc3ZmUyNzg5OWI4MjAyNjEiLCJleHAiOjE3NzIxNDgzNjksInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.7iRQLub-VrLOfGDPxJaHURWVGXp5hd6ksE3WMzLamIw' | bash"}

…n isolated networks managed by external capsules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant