I’m trying to create “Amazon Linux 2” product into my Forman katello serve and add “Amazon Linux 2” repositories. I create a yum repository as below :
[root@forman~]# hammer repository info --id 23
Id: 23
Name: Amazon Linux 2 core
Label: name_Amazon_Linux_2_core_repository
Description:
Organization: My_Organization
Red Hat Repository: no
Content Type: yum
Mirror on Sync: yes
Url: http://amazonlinux.us-east-1.amazonaws.com/2/core/latest/x86_64/mirror.list
Publish Via HTTP: yes
Published At: https://localhost/pulp/content/My_Organization/Library/custom/AMAZON-LINUX-2/name_Amazon_Linux_2_core_repository/
Relative Path: My_Organization/Library/custom/AMAZON-LINUX-2/name_Amazon_Linux_2_core_repository
Download Policy: immediate
HTTP Proxy:
Id: 1
Name: myproxy.mydomain.net
HTTP Proxy Policy: use_selected_http_proxy
Product:
Id: 5
Name: AMAZON-LINUX-2
GPG Key:
Id: 6
Name: GPG-KEY-AMAZON-LINUX-2
Sync:
Status: Warning
Last Sync Date: about 17 hours
Created: 2021/05/08 18:01:01
Updated: 2021/05/08 18:10:42
Content Counts:
Packages: 0
Source RPMS: 0
Package Groups: 0
Errata: 0
Module Streams: 0
But I’m not able to sync the repository and I get error below : 403, message='Forbidden', url=URL('http://amazonlinux.us-east-1.amazonaws.com/blobstore/24c8c7b64056e3963a158cefd9b301c94443194a8569684056656260cd49c8f4/java-11-amazon-corretto-headless-11.0.7+10-1.amzn2.x86_64.rpm')
Did you guys tried to add “Amazon Linux 2” repositories into Forman katello install?
I am not sure about authentication, but one customer explained to me it requires an Amazon Linux to get access. So what we did was using reposync to get a mirror and as reposync does not sync all metadata use modifyrepo_c to add the additional metadata from the systems yum cache. This local repository was then synced to Katello.
I have saved me a copy of the scripts a everything was straight forward except from the authentication which the customer already prepared.
This was one technical step in a pre-sales date, so I am not sure if I remember everything.
The system was already configured to get updates from Amazon so yum configuration already existed and was working fine. reposync allows to repository locally based on the yum configuration, we added the options --downloadcomps --download-metadata --newest-only to reduce size but get all metadata. We then recognized that errata metadata are missing as reposync did not seem to handle them, but they were stored to /var/cache/yum and with modifyrepo_c allowing to add metadata we took them from the cache and added them to the local repository. Not sure if a createrepo_c was required first, but I think the initial metadata were provided by reposync.
With this we got the repository to Katello and then the customer wanted to test deployment and subscription-manager, as he reported no error I think it worked without any hassle, but I do not know.
Hope this helps at least a bit. If you get it to work, feel free to write a short tutorial. If not, I will try to help but I have no access to Amazon Linux at the moment (and no time) to work through it completely.
Do you have a server which is running Amazon Linux 2 and has access to the repositories? The repo file should contain all information necessary to access the repository, unless they use a special plugin or limit access by IP address…
But I’m not able to sync the repository and I get error below : 403, message='Forbidden', url=URL('http://amazonlinux.us-east-1.amazonaws.com/blobstore/24c8c7b64056e3963a158cefd9b301c94443194a8569684056656260cd49c8f4/java-11-amazon-corretto-headless-11.0.7+10-1.amzn2.x86_64.rpm')
You can run “yum repolist -v amzn2-core” to see the actual URL used.
The report_instanceid in the repo configuration seems to be an Amazon extension. I looks to me as if they want to make sure that it’s only accessible on servers in their cloud running AL2.