Setup repo for RHEL without satellite subscription in Foreman

Problem:
Connect to redhat repository
Expected outcome:

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

Hi guys

I wanted to know how I can create the content and product repository connecting with Redhat and Redhat addresses, right now I have created the repos against Centos but I want to create it against Redhta Repos can you help me

Generic answer without knowing the foreman/katello version you use:

See docs: Content Management Guide

1 Like

We need to know to create 4. In the URL to Discover field, enter the Redhat Repo not Syc with Centos

1.2.1. Creating repositories to synchronize

Use this procedure to discover available repositories in the CentOS Stream, then select the repositories to mirror into a product.

Procedure

  1. In the Foreman web UI, navigate to Content > Products.
  2. Click Repo Discovery.
  3. In the Repository Type field, select Yum Repositories.
  4. In the URL to Discover field, enter the CentOS Stream URL http://mirror.centos.org/centos/8-stream.
  5. Click Discover.
  6. Select /AppStream/x86_64/os/ and /BaseOS/x86_64/os/ repositories.
  7. Click Create Selected.
  8. In the Product field select New Product.
  9. In the Name field enter CentOS Stream or desired product name.
  10. Click Run Repository Creation.

To view your newly created product, navigate to Content > Products, and select the name of the new product.

I did not link to chapter 1.2.1 but to chapter 4. My browser immediately takes me there if I click on the link above. Read chapter 4 “Managing Subscriptions”. You need to import the subscription from redhat to get the repositories. The manifest contains all the information.

OK Add Manifest Subscription on Redhat but we have mesage error

Hello

When importing the maniest of Redhat in foreman we got an error 401 unahutorized, this might not have communication? have any other access problem? What is the baseurl you use to connect to subscriptions and repositories?

KR Ricardo

When try to Discovery Repository we have recibe this error

Can you fullfill this ?

The process of adding redhat repositories is documented.

Quickly, you have to create a subscription allocation with type SAM 1.4 and add the desired subscriptions to it. Then you download the manifest and add it to the foreman.
From there you can add the repos in Content> Redhat repos. It then appears in the products, it only remains to sync.

Notes the redhat repos available are directly linked to the subscriptions added in the manifest.

If you use a proxy, you can enter it in Settings> General.

When refresh manifest look the warning mensage

Errors:
Invalid credentials.

i have do this

subscription-manager register --auto-attach


* Run the following command to enable the rhel-6-server-sam-rpms repository and disable Enhanced Updates (EUS) repository

[Raw](https://access.redhat.com/solutions/70584#)

subscription-manager repos --enable rhel-6-server-sam-rpms --disable rhel-server-rhscl-6-eus-rpms


* Then, install Subscription Asset Manager using

[Raw](https://access.redhat.com/solutions/70584#)

yum install -y katello-headpin-all


* Then, configure Subscription Asset Manager (see [Additional Examples of the Configuration Script](https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/Using_Subscription_Asset_Manager/sect-Red_Hat_Subscription_Asset_Manager-User_Guide-Installing_SAM-Additional_Examples_of_the_Configuration_Script.html) for options to override default values or populate from answer file) with following command (the --org option is not required but helpful to set to the name of the initial organization name for your deployment, otherwise it defaults to "ACME_Corporation")

[Raw](https://access.redhat.com/solutions/70584#)

katello-configure --deployment=sam --org=Name_of_Your_Org --user-pass=Your_Admin_Password

on foreman server ?

we have this subscription available

hello again i see not repsitory available on repository field see image

image

KR ricardo.

You have to assign entitlements to the allocation and then export the manifest and import it into foreman.

How many entitlements have you assigned to the allocation?

we have 3 entitlements on alocate subscription

and add 1 maybe I have to add all 3? is that so?

Now export the manifest and import it into foreman.

but something is giving 401 error as you can see in the image in the server log we see the same error

2021-06-28T09:27:30 [I|app|21448] Processing by Api::V2::TablePreferencesController#index as JSON
2021-06-28T09:27:30 [I|app|21448] Parameters: {“apiv”=>“v2”, “user_id”=>“4”}
2021-06-28T09:27:30 [I|app|21448] Current user set to admin (admin)
2021-06-28T09:27:30 [I|app|21448] Rendering api/v2/table_preferences/index.json.rabl within api/v2/layouts/index_layout
2021-06-28T09:27:30 [I|app|21448] Rendered api/v2/table_preferences/index.json.rabl within api/v2/layouts/index_layout (1.9ms)
2021-06-28T09:27:30 [I|app|21448] Completed 200 OK in 32ms (Views: 10.6ms | ActiveRecord: 12.1ms)
2021-06-28T09:27:30 [I|app|] Started GET “/katello/api/v2/subscriptions?organization_id=3” for 172.22.183.198 at 2021-06-28 09:27:30 +0200
2021-06-28T09:27:30 [I|app|8da38] Processing by Katello::Api::V2::SubscriptionsController#index as JSON
2021-06-28T09:27:30 [I|app|8da38] Parameters: {“organization_id”=>“3”, “api_version”=>“v2”}
2021-06-28T09:27:30 [I|app|8da38] Current user set to admin (admin)
2021-06-28T09:27:30 [I|app|8da38] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.1.1/app/views/katello/api/v2/subscriptions/index.json.rabl within katello/api/v2/layouts/collection
2021-06-28T09:27:31 [I|app|50ea3] Completed 200 OK in 819ms (Views: 0.4ms | ActiveRecord: 728.6ms)
2021-06-28T09:27:31 [E|app|71b73] Unable to find upstream owner for consumer
2021-06-28T09:27:31 [E|app|71b73] exception when talking to a remote client: 401 Unauthorized RestClient::Unauthorized: 401 Unauthorized
Body: {“displayMessage”:“Invalid credentials.”,“requestUuid”:“48c0edb4-7b02-4291-93ec-e2d850a91375”}
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in exception_with_response' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in return!’
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:809:in process_result' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in block in transmit’
/opt/rh/rh-ruby25/root/usr/share/ruby/net/http.rb:910:in start' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in transmit’
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in execute’
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:51:in `get’
–Más–(17%)

export manifest and import manifest

Could you try refresh manifest via Manage Manifest - Refresh.

1 Like

yes i refresh manifest and now dont have error but in the next step how to create a product and content

Hello

i have already subscription without error

but in the Repository device I don’t have the option to add them

image

I only see ansible repositories in the list, not extra server or os