Create a composite content view, and use a content view filter to limit which packages are visible to hosts.
Outcomes
Create a composite content view.
Configure a content view filter.
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 software-filter
Instructions
Log in to the web UI, https://satellite.lab.example.com, as admin 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.
Enable synchronization of the Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs) repository.
Click → .
Enter rhel-9-for-x86_64-highavailability-rpms in the field, and then click .
In the list, click the greater-than symbol (>) to the left of the Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs) repository to expand the version information.
Click the plus sign (+) to the right of to enable that repository and version.
Verify that the client repository is listed in the list, and that the repository is for RHEL 9.
Synchronize the Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs) repository.
Click → and then click .
On the tab, select the checkbox for the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository, and then click .
Wait for the task to complete.
Create the OpsBaseHA content view.
Click → and click .
On the page, enter OpsBaseHA in the field.
The field is autogenerated from the field.
Enter High availability packages in the field, and then click to display the selection page.
Select the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository, and then click .
Create a filter for the OpsBaseHA content view and configure it to exclude Pacemaker packages that are earlier than version 2.1.4.
On the OpsBaseHA content view web page, click the tab, and then click .
Complete the page with the following details. Verify that the fields are correct, and then click .
| Field | Value |
|---|---|
| Name | Pacemaker-before-2.1.4 |
| Content Type | RPM |
| Inclusion Type | Exclude |
| Description | Excluding Pacemaker packages earlier than 2.1.4 |
Click to start adding a new rule to the filter.
Create a rule with the following details:
| Field | Value |
|---|---|
| RPM Name | pacemaker |
| Architecture | x86_64 |
| Version | Less Than |
| Maximum Version | 2.1.4 |
Verify that the fields are correct, and then click .
Publish a new version of the OpsBaseHA content view, and promote this version to the Development lifecycle environment.
Click to display the page.
Enter HA repository in the field, and then click .
Review the details and click .
After the content view is published, the tab is selected.
The OpsBaseHA content view is in the Library environment.
Click .
Select the checkbox for , and enter HA repository in the field.
Click to start the promotion.
Wait for the promotion to complete.
Create a composite view named BaseHAComposite, which includes both the OperationsServerBase and OpsBaseHA content views.
Click → , and then click .
On the page, enter BaseHAComposite in the field.
The field is autogenerated from the field.
Enter Server base and HA packages in the field.
Select the Composite content view type.
Select the Auto Publish checkbox, and then click .
Select the checkboxes for the OperationsServerBase and OpsBaseHA content views, and then click .
In the dialog, review the information, and then click .
In the tab, verify that the status for both content views is Added.
Publish a new version of the BaseHAComposite composite view, and promote this version to the Development lifecycle environment.
Click .
Enter Server base and HA content views repositories in the field and click .
Review the details and then click .
After the composite content view is published, the tab is displayed.
The BaseHAComposite composite view is published to the Library environment.
Click .
Select the Development lifecycle, and enter Server base and HA content views repositories in the field.
Click to start the promotion.
Wait for the promotion to complete.
Update the serverc content host to use the BaseHAComposite content view in the Development environment of the Operations organization.
On workstation, log in to the serverc system as the student user and switch to the root user.
[student@workstation ~]$ssh student@serverc[student@serverc ~]$sudo -i[sudo] password for student:student[root@serverc ~]#
Verify the current environment and content view for the serverc content host.
The serverc host is in the QA environment with the OperationsServerBase content view.
[root@serverc ~]# subscription-manager identity
system identity: 3244ed9d-ce23-4a2a-a39d-112324d84b3c
name: serverc.lab.example.com
org name: Operations
org ID: Operations
environment name: QA/OperationsServerBaseIn a different terminal window on workstation, log in to the satellite system as the student user and switch to the root user.
Update the serverc host's lifecycle environment and content view.
Because the serverc host is already in the Operations organization, the task is only a host update and does not require another host registration.
After the command completes successfully, keep open the satellite terminal window.
[student@workstation ~]$ssh student@satellite[student@satellite ~]$sudo -i[sudo] password for student:student[root@satellite ~]#
[root@satellite ~]# hammer host update --name serverc.lab.example.com \
--lifecycle-environment Development \
--content-view BaseHAComposite \
--organization Operations
Host updated.In the terminal window on the serverc host, verify that the environment and content view are updated.
The serverc host is in the Development environment with the BaseHAComposite content view.
[root@serverc ~]# subscription-manager identity
system identity: 3244ed9d-ce23-4a2a-a39d-112324d84b3c
name: serverc.lab.example.com
org name: Operations
org ID: Operations
environment name: Development/BaseHACompositeVerify that the serverc host has access to the repositories for the BaseHAComposite content view.
Verify the pacemaker package versions that are available on the serverc host.
Verify the repositories that are available on the serverc host.
The repositories are from the BaseHAComposite content view.
[root@serverc ~]# subscription-manager repos --list
1 local certificate has been deleted.
+----------------------------------------------------------+
Available Repositories in /etc/dnf.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: rhel-9-for-x86_64-highavailability-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs)
Repo URL: https://satellite.lab.example.com/pulp/content/Operations/Develop...
Enabled: 0
Repo ID: rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL: https://satellite.lab.example.com/pulp/content/Operations/Develop...
Enabled: 1
Repo ID: satellite-client-6-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)
Repo URL: https://satellite.lab.example.com/pulp/content/Operations/Develop...
Enabled: 1
Repo ID: rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL: https://satellite.lab.example.com/pulp/content/Operations/Develop...
Enabled: 1Enable the rhel-9-for-x86_64-highavailability-rpms repository.
[root@serverc ~]# subscription-manager repos \
--enable=rhel-9-for-x86_64-highavailability-rpms
Repository 'rhel-9-for-x86_64-highavailability-rpms' is enabled for this system.Verify which pacemaker package versions are available.
Of the several listed versions, none are earlier than version 2.1.4, as specified in the content view's exclude filter.
[root@serverc ~]# dnf list pacemaker --showduplicates
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS 78 kB/s | 2.4 kB 00:00
Red Hat Enterprise Linux 9 for x86_64 - High Av 85 kB/s | 2.6 kB 00:00
Red Hat Satellite Client 6 for RHEL 9 x86_64 (R 65 kB/s | 2.1 kB 00:00
Red Hat Enterprise Linux 9 for x86_64 - AppStre 66 kB/s | 2.4 kB 00:00
Available Packages
pacemaker.x86_64 2.1.4-5.el9 rhel-9-for-x86_64-highavailability-rpms
pacemaker.x86_64 2.1.4-5.el9_1.2 rhel-9-for-x86_64-highavailability-rpmsDelete the Pacemaker-before-2.1.4 filter from the OpsBaseHA content view.
Republish the OpsBaseHA and BaseHAComposite content views.
In the following steps, you must delete the filters that you created in this exercise, because active filters can significantly increase a content view's synchronization time. Deleting the filters from your content views shortens your synchronization wait time in later exercises.
In the terminal window on the satellite system, delete the Pacemaker-before-2.1.4 filter.
[root@satellite ~]# hammer content-view filter delete \
--name Pacemaker-before-2.1.4 \
--content-view OpsBaseHA \
--organization Operations
Filter deleted.Publish and promote a new version of the OpsBaseHA content view to the Development lifecycle environment.
[root@satellite ~]# hammer content-view publish \
--name OpsBaseHA \
--lifecycle-environments Development \
--organization Operations
[.....................................................................] [100%]Update the BaseHAComposite composite content view with the latest version of the OpsBaseHA content view.
[root@satellite ~]# hammer content-view component update \
--latest \
--component-content-view OpsBaseHA \
--composite-content-view BaseHAComposite \
--organization Operations
Content view component updated.Publish and promote a new version of the BaseHAComposite composite content view to the Development lifecycle environment.
[root@satellite ~]# hammer content-view publish \
--name BaseHAComposite \
--lifecycle-environments Development \
--organization Operations
[.....................................................................] [100%]Exit and close the terminal window to the satellite system.
[root@satellite ~]#exitlogout [student@satellite ~]$exitlogout [student@workstation ~]$exitlogout
In the serverc terminal window, return to the workstation system as the student user.
[root@serverc ~]#exitlogout [student@serverc ~]$exitlogout [student@workstation ~]$