Export content view packages to file system storage, and query the resulting package storage structure.
Outcomes
Export a content view to disk.
View the layout of the content view archive.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start maintain-views
Instructions
Log in to the Satellite Server web UI, https://satellite.lab.example.com, as the admin user with redhat as the password.
In the upper-left corner of the web page, set the organization to Operations.
Set the location to Any Location.
Verify that the download policy for the repository is set to Immediate.
Click → , and then click .
Click .
Verify that the setting is Immediate.
Click , and then click . Wait for the task to complete.
Verify that the repository is included in the OperationsServerBase content view.
Click → , and then click .
Click , and verify that the repository is present.
Export the OperationsServerBase 1.0 content view.
Log in to the satellite system as the student user and switch to the root user.
[student@workstation ~]$ssh satellite[student@satellite ~]$sudo -i[sudo] password for student:student[root@satellite ~]#
List the content views for the Operations organization.
Note the ID for the OperationsServerBase 1.0 content view.
[root@satellite ~]#hammer --output base \ content-view version list \ --organization OperationsId: 5 Name: OperationsServerBase 2.0 Version: 2.0 Description: Base Repositories v2 Lifecycle Environments: Library, Development Id:4Name:OperationsServerBase 1.0Version: 1.0 Description: Base Repositories Lifecycle Environments: Id: 3 Name: Default Organization View 1.0 Version: 1.0 Description: Lifecycle Environments: Library
Export the OperationsServerBase 1.0 content view.
[root@satellite ~]#hammer content-export complete version\--content-view Base\--id 4\--organization Operations[....................................................................] [100%] Generated /var/lib/pulp/exports/Operations/OperationsServerBase/1.0/2022-08-08T20-58-12-04-00/metadata.json
Examine the archive that contains the exported version of the content view. Change directory to the archive directory from the previous command output.
[root@satellite ~]# cd \
/var/lib/pulp/exports/Operations/OperationsServerBase/1.0/2022-08-08T20-58-12-04-00/Explore the contents of the content view archive. Your file size and attributes would differ from this example.
[root@satellite 2022-08-08T20-58-12-04-00]#ls -lhtotal 1.1G -rw-r--r--. 1 pulp pulp 1.1G Aug 8 20:59export-4689127b-7fc1-4d3c-aaeb-3c833828e2a3-20220809_0058.tar.gz-rw-r--r--. 1 pulp pulp 333 Aug 8 20:59export-4689127b-7fc1-4d3c-aaeb-3c833828e2a3-20220809_0058-toc.json-rw-r--r--. 1 root root 1.1K Aug 8 20:59metadata.json
View the metadata.json file content.
[root@satellite 2022-08-08T20-58-12-04-00]#cat metadata.json | json_reformat{ organization: Operations, repositories: { Red_Hat_Enterprise_Linux_9_for_x86_64_-BaseOS_RPMs_9-102922: { name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9, label: Red_Hat_Enterprise_Linux_9_for_x86_64-_BaseOS_RPMs_9, ...output omitted... os_versions: [ ], major: 4, minor: 4, download_policy: immediate, mirroring_policy: mirror_complete, product: { label: Red_Hat_Enterprise_Linux_for_x86_64 }, ...output omitted...
Return to the workstation system as the student user.
[root@satellite 2022-08-08T20-58-12-04-00]#exitlogout [student@satellite ~]$exitlogout Connection to satellite closed. [student@workstation ~]$