Hammer command (or other means) to get channelid
I'm familiar with the command:
myorg="org name goes here"
hammer --csv repository list --organization "$myorg"
And it returns output such as...
57,Red Hat Satellite Tools 6.2 for RHEL 7 Workstation RPMs x86_64,Red Hat Enterprise Linux Workstation,yum,https://cdn.redhat.com/content/dist/rhel/workstation/7/7Workstation/x86_64/sat-tools/6.2/os
29,Red Hat Satellite Tools 6.2 for RHEL 7 Server RPMs x86_64,Red Hat Enterprise Linux Server,yum,https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.2/os
108,Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs x86_64,Red Hat Enterprise Linux Server,yum,https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/sat-tools/6.2/os
109,Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs i386,Red Hat Enterprise Linux Server,yum,https://cdn.redhat.com/content/dist/rhel/server/6/6Server/i386/sat-tools/6.2/os
60,Red Hat Satellite Capsule 6.2 for RHEL 7 Server RPMs x86_64,Red Hat Satellite Capsule,yum,https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.2/os
61,Red Hat Satellite Capsule 6.2 for RHEL 6 Server RPMs x86_64,Red Hat Satellite Capsule,yum,https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/sat-capsule/6.2/os
389,Red Hat Satellite 6.3 - Puppet 4 for RHEL 7 Server RPMs x86_64,Red Hat Satellite,yum,https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/satellite/6.3-puppet4/os
388,Red Hat Satellite 6.3 for RHEL 7 Server RPMs x86_64,Red Hat Satellite,yum,https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/satellite/6.3/os
59,Red Hat Satellite 6.2 for RHEL 7 Server RPMs x86_64,Red Hat Satellite,yum,https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/satellite/6.2/os
58,Red Hat Satellite 6.2 for RHEL 6 Server RPMs x86_64,Red Hat Satellite,yum,https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/satellite/6.2/os
However, if I want to do a reposync, I need the channel id such as:
reposync --gpgcheck -l --repoid=rhel-server-rhscl-7-rpms --download_path=/path/to/the/download/
The repoid in question in this case is "rhel-server-rhscl-7-rpms"
So on one side, I can get most of the information with the hammer --csv repository list --organization "$myorg" command, however, the output doesn't have the repoid name in the second block I have above.
What command can I use to get the name such as "rhel-server-rhscl-7-rpms" (for example).
Where this is more useful is when a new channel is released, because I know I can get some of the channel names from things my satellite has synchronized, but if I've never synchronized a new channel (such as satellite 6.3), then I wouldn't just be able to fish in my own filesystem for the name since I hadn't downloaded it yet.
My question is how to get repoids such as " "rhel-server-rhscl-7-rpms" for all the channels.
Appreciate any assistance.
-RJ
Responses
I dont know if there is an easy way to get those repoIDs from Satellite short of maybe digging into the database, which we advise against. However, your manifest does have that info.
A couple of patches to the rct command can enable this.
First, make a backup of /usr/lib/python2.7/site-packages/rct/manifest_commands.py
cp /usr/lib/python2.7/site-packages/rct/manifest_commands.py{,-old}
Next, deploy the patched manifest_commands.py. Available as a gist here if you want to download it, inspect it, and/or diff it against your existing version before running the command below.
wget https://gist.githubusercontent.com/sideangleside/d1ce75e0a776073868d9e31793cd6920/raw/6c0238d322f69062c0db3da2815c5887fc10d354/manifest_commands.py -O /usr/lib/python2.7/site-packages/rct/manifest_commands.py
Next, run rct against your manifest.
rct cat-manifest /path/to/manifest.zip
+-------------------------------------------+
Manifest
+-------------------------------------------+
General:
Server:
Server Version: 2.0.43-1
Date Created: 2017-12-20T03:01:45.981+0000
Creator:[REDACTED]
Consumer:
Name: [REDACTED]
UUID: [REDACTED]
Content Access Mode: entitlement
Type: satellite
Subscription:
Name: Red Hat Enterprise Linux Developer Support, Enterprise
Quantity: 625
Created: 2017-10-05T10:33:21.000+0000
Start Date: 2017-09-15T04:00:00.000+0000
End Date: 2018-09-15T03:59:59.000+0000
Service Level: Dev-Enterprise
Service Type: L1-L3
Architectures: ia64,ppc,ppc64,ppc64le,s390,s390x,x86,x86_64
SKU: RH2264664
Contract: [REDACTED]
Order: [REDACTED]
Account: [REDACTED]
Virt Limit: unlimited
Requires Virt-who: True
Sockets: 8
Stackable: False
Cores: Not Applicable
Instance Multipler: Not Applicable
Cloud Access: Not Applicable
Entitlement File: export/entitlements/8a99f9845ee8b387015eec18c9ef1416.json
Certificate File: export/entitlement_certificates/3119701997280027621.pem
Certificate Version: 3.3
Provided Products:
69: Red Hat Enterprise Linux Server
70: Red Hat Enterprise Linux Server - Extended Update Support
83: Red Hat Enterprise Linux High Availability (for RHEL Server)
84: Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support
85: Red Hat Enterprise Linux Load Balancer (for RHEL Server)
86: Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
90: Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
91: Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support
92: Red Hat Enterprise Linux Scalable File System (for RHEL Server)
93: Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
132: Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
133: Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
172: MRG Realtime
176: Red Hat Developer Toolset (for RHEL Server)
180: Red Hat Beta
190: Red Hat Developer Toolset (for RHEL Server EUS)
201: Red Hat Software Collections (for RHEL Server)
205: Red Hat Software Collections Beta (for RHEL Server)
240: Oracle Java (for RHEL Server)
246: Oracle Java (for RHEL Server) - Extended Update Support
271: Red Hat Enterprise Linux Atomic Host
272: Red Hat Enterprise Linux Atomic Host Beta
273: Red Hat Container Images
274: Red Hat Container Images Beta
287: Red Hat Enterprise Linux for Real Time
293: Red Hat Container Development Kit
317: dotNET on RHEL (for RHEL Server)
318: dotNET on RHEL Beta (for RHEL Server)
394: Red Hat Developer Tools (for RHEL Server)
395: Red Hat Developer Tools Beta (for RHEL Server)
Derived Products:
Facts:
VIRT_LIMIT: This subscription supports up to unlimited guests
SOCKETS: This subscription supports systems with up to 8 sockets
STACKABLE: This subscription is not stackable
Content Sets & Labels:
Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 RHEL 6 Server EUS
Label: rhel-server-rhscl-6-eus-rpms
URL: /content/eus/rhel/server/6/$releasever/$basearch/rhscl/1/os
Name: Red Hat Software Collections Source RPMs for Red Hat Enterprise Linux 7 RHEL 7 Server EUS
Label: rhel-server-rhscl-7-eus-source-rpms
URL: /content/eus/rhel/server/7/$releasever/$basearch/rhscl/1/source/SRPMS
Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 Server
Label: rhel-server-rhscl-6-rpms
URL: /content/dist/rhel/server/6/$releasever/$basearch/rhscl/1/os
Name: Red Hat Software Collections (Source ISOs) for Red Hat Enterprise Linux 7 Server
Label: rhel-7-server-rhscl-source-isos
URL: /content/dist/rhel/server/7/$releasever/$basearch/rhscl/1/source/iso
Name: Red Hat Software Collections Source RPMs for Red Hat Enterprise Linux 6 RHEL 6 Server EUS
The Label value is your repository name as known by subscription-manager and the product docs.
The Name value is the display name of the repository as seen in the Satellite UI & CLI.
Based on this conversation, I've opened up the following two RFEs:
- BZ1548370 [RFE] As a user of the 'rct' command, I'd like to see the repository Name and Label displayed as part of the cat-manifest sub-command.
- BZ1548381 [RFE] As a user of Satellite, I'd like to see the repository label displayed on the Red Hat Repositories page
I think both capture the spirit of what you are trying to accomplish. Let me know if I missed anything. And also, open up a case with Support referencing these RFEs as it helps us with prioritization.
Remember that a manifest is a point-in-time snapshot which contains
- a listing of repositories you can access to and can sync
- which certificates are used to sync those repositories.
- which subscriptions are available.
The listing of which repositories you can sync is something that we (Red Hat) have to explicitly update each release for most products. [1]. Basically, we have a backend process that is an automated part of the release process that says (for example): 'find all accounts that currently have access to Satellite content, and update them so that Satellite 6.3 repos are available'. Sometimes these take a while to complete globally. This is why sometimes you get the error of not being able to sync or enable a repo.
Thus from start to finish:
- Red Hat pushes out Satellite 6.3, along with the aforementioned updates to accounts.
- You (Satellite users) refresh your manifest. (Either via the Satellite UI or via the Customer Portal depending on if you are connected versus disconnected)
- You select new repos.
[1] - Note, I said for most products. In the case of RHEL, the content sets (which repos do you have access to) are defined a little differently. See the below example (snipped from the rct content above)
Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 Server
Label: rhel-server-rhscl-6-rpms
URL: /content/dist/rhel/server/6/$releasever/$basearch/rhscl/1/os
You can see the $releasever and $basearch values in the URL. This basically states that the manifest will allow access to all values of releasever (6.4, 6.5, 7Server, etc) or basearch (i386, x86_64). So it's a 'one size fits all' solution and for when new versions of RHEL are released, you generally dont need a manifest refresh. Not all repositories are setup that way though.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
