Work with hosts in two lifecycle environments for testing and production, and deploy different versions of the same software to hosts in the two environments.
Outcomes
Register a host to a specific lifecycle environment and content view.
Deploy software from different lifecycle environments and content views.
Create a composite content view.
Configure a content view filter.
Create an errata content view filter.
Apply errata to managed hosts.
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-review
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 Finance.
Set the location to Any Location.
Verify that a version of the FinanceServerBase content view is available, and that the serverb content host is assigned to use the FinanceServerBase content view in the Build lifecycle environment.
Verify that the ant package is not available on the serverb system.
Log in to the serverb system as the student user and switch to the root user.
[student@workstation ~]$ssh student@serverb[student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Verify that the ant package is not available on the serverb system.
[root@serverb ~]# dnf list ant
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS 14 kB/s | 2.4 kB 00:00
Error: No matching Packages to listModify the FinanceServerBase content view to include the following repositories.
Publish and promote a new version of the content view to the Build lifecycle environment.
Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9
Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs
Click → , and then click .
Click the tab.
Select the checkboxes for the Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9 and Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs repositories, and then click .
Click . Click the switch, and then select the checkbox. Click . Review the details and click . Wait for the process to complete.
Install the ant package on serverb.
The ant package is now available from the added repositories in the content view.
Enable and synchronize 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 Available Repositories 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 Enabled Repositories list and that the repository is for RHEL 9.
Click → , and then click .
On the tab, click the checkbox next to the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository, and then click .
Wait until the process is complete.
Create a FinBaseHA content view that contains the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository.
Create a Pacemaker-before-2.1.4 filter for the FinBaseHA content view.
Exclude pacemaker packages that are earlier than version 2.1.4 for the x86_64 architecture.
On the FinBaseHA content view page, click the tab, and then click .
Complete the page with the following details. Verify that the details are correct, and then click .
| Field | Value |
|---|---|
| Name | Pacemaker-before-2.1.4 |
| Content Type | RPM |
| Inclusion Type | Exclude |
Click to add a rule to the filter.
Create a rule with the following details. Verify that the details are correct, and then click .
| Field | Value |
|---|---|
| RPM Name | pacemaker |
| Architecture | x86_64 |
| Version | Less Than |
| Maximum Version | 2.1.4 |
Publish and promote a new version for the FinBaseHA content view to the Build lifecycle environment.
Create a BaseHAComposite composite content view that includes both the FinanceServerBase and FinBaseHA content views.
Set this content view to auto publish.
Click → , and then click .
On the page, enter BaseHAComposite in the field.
The field is automatically populated from the field content.
Select the Composite content view type.
Select the Auto Publish checkbox, and then click .
Select the checkboxes for the FinBaseHA and FinanceServerBase content views, and then click .
Review the details, and then click .
In the tab, verify that the status for both content views is Added.
Publish and promote a new version of the BaseHAComposite composite view to the Test lifecycle environment.
Update the serverb content host to use the BaseHAComposite content view in the Test environment of the Finance organization.
In the serverb terminal window, verify the current environment and content view for the serverb content host.
The serverb host is in the Build environment with the FinanceServerBase content view.
[root@serverb ~]# subscription-manager identity
system identity: 8fa907ce-7e50-4ee0-8070-b19847e3a5a2
name: serverb.lab.example.com
org name: Finance
org ID: Finance
environment name: Build/FinanceServerBaseIn a different terminal window on the workstation system, log in to the satellite system as the student user and switch to the root user.
Update the serverb host's lifecycle environment and content view.
Because the serverb host is already in the Finance organization, the task is only a host update and does not require another host registration.
After the command completes successfully, exit 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 serverb.lab.example.com \
--lifecycle-environment Test \
--content-view BaseHAComposite \
--organization Finance
Host updated.[root@satellite ~]#exitlogout [student@satellite ~]$exitlogout [student@workstation ~]$exitlogout
In the terminal window on the serverb host, verify that the environment and content view are updated.
The serverb host is in the Test environment with the BaseHAComposite content view.
[root@serverb ~]# subscription-manager identity
system identity: 8fa907ce-7e50-4ee0-8070-b19847e3a5a2
name: serverb.lab.example.com
org name: Finance
org ID: Finance
environment name: Test/BaseHACompositeVerify that the serverb host has access to the repositories for the BaseHAComposite content view.
Verify the pacemaker package versions that are available on the serverb host.
Verify the repositories that are available on the serverb host.
The repositories are from the BaseHAComposite content view.
[root@serverb ~]# 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: 0
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@serverb ~]# 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 versions of the pacemaker package are available.
[root@serverb ~]# dnf list pacemaker --showduplicates
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS 77 kB/s | 2.4 kB 00:00
Red Hat Enterprise Linux 9 for x86_64 - AppStre 84 kB/s | 2.4 kB 00:00
Red Hat Enterprise Linux 9 for x86_64 - High Av 84 kB/s | 2.6 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-rpmsReturn to workstation as the student user.
[root@serverb ~]#exitlogout [student@serverb ~]$exitlogout [student@workstation ~]$
Create a Non-security Errata filter in the FinanceServerBase content view that excludes all non-security errata that are dated January 1, 2022 and later.
Publish a new version of the content view with the filter, and promote the version to the Build and Test lifecycle environment.
Click → , and then click the content view. Click the tab and then click .
Create a filter with the following details. Verify that the fields are correct, and then click .
| Field | Value |
|---|---|
| Name | Non-security Errata |
| Content Type | Errata - by date range |
| Inclusion Type | Exclude |
Clear the checkbox in the list.
Select January 1, 2022 in the field, and then click .
Click for the FinanceServerBase content view.
Enter Added non-security errata in the field.
Click the Promote switch, and then select the and checkbox.
Click .
Review the details, and then click .
Verify that the new version has fewer packages than the previous content view version.
You must run the lab finish command after you have completed the lab grading command.
The lab finish command deletes 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.