Bookmark this page

Lab: Deploy Software to Hosts

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

  1. Log in to the web UI, https://satellite.lab.example.com, as admin with redhat as the password.

  2. In the upper-left corner of the web page, set the organization to Finance. Set the location to Any Location.

  3. 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.

    1. Click ContentContent Views, and then click FinanceServerBase.

    2. Click the Versions tab, and then verify that a version is available to the Build lifecycle environment.

    3. Click HostsContent Hosts, and then click serverb.lab.example.com.

    4. Click the Details tab. In the Content Host Content section, verify the Release Version is set to 9.

  4. Verify that the ant package is not available on the serverb system.

    1. 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 ~]#
    2. 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 list
  5. Modify 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

    1. Click ContentContent Views, and then click FinanceServerBase.

    2. Click the Repositories 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 Add repositories.

    3. Click Publish new version. Click the Promote switch, and then select the Build checkbox. Click Next. Review the details and click Finish. Wait for the process to complete.

  6. Install the ant package on serverb. The ant package is now available from the added repositories in the content view.

    1. Install the ant package on the serverb system. Keep open the serverb system's terminal session.

      [root@serverb ~]# dnf install ant
      ...output omitted...
      Is this ok [y/N]: y
      ...output omitted...
      Complete!
  7. Enable and synchronize the Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs) repository.

    1. Click ContentRed Hat Repositories. Enter rhel-9-for-x86_64-highavailability-rpms in the Search field, and then click Search.

    2. 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 x86_64 9 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.

    3. Click ContentProducts, and then click Red Hat Enterprise Linux High Availability for x86_64.

    4. On the Repositories tab, click the checkbox next to the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository, and then click Sync Now. Wait until the process is complete.

  8. Create a FinBaseHA content view that contains the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository.

    1. Click ContentContent Views, and then click Create content view.

    2. On the Create content view page, enter FinBaseHA in the Name field. The Label field is autogenerated from the Name field.

    3. Click Create content view to display the Repositories selection page. Select the checkbox for the Red Hat Enterprise Linux 9 for x86_64 - High Availability RPMs 9 repository, and then click Add repositories.

  9. 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.

    1. On the FinBaseHA content view page, click the Filters tab, and then click Create filter.

    2. Complete the Create filter page with the following details. Verify that the details are correct, and then click Create filter.

      FieldValue
      NamePacemaker-before-2.1.4
      Content TypeRPM
      Inclusion TypeExclude
    3. Click Add RPM rule to add a rule to the filter.

    4. Create a rule with the following details. Verify that the details are correct, and then click Add rule.

      FieldValue
      RPM Namepacemaker
      Architecturex86_64
      VersionLess Than
      Maximum Version2.1.4
  10. Publish and promote a new version for the FinBaseHA content view to the Build lifecycle environment.

    1. Click ContentContent Views, and then click FinBaseHA.

    2. Click Publish new version to display the Publish page. Click the Promote switch, and select the checkbox for the Build environment. Click Next. Review the details, and then click Finish. Wait for the process to complete.

  11. Create a BaseHAComposite composite content view that includes both the FinanceServerBase and FinBaseHA content views. Set this content view to auto publish.

    1. Click ContentContent Views, and then click Create content view.

    2. On the Create content view page, enter BaseHAComposite in the Name field. The Label field is automatically populated from the Name field content. Select the Composite content view type. Select the Auto Publish checkbox, and then click Create content view.

    3. Select the checkboxes for the FinBaseHA and FinanceServerBase content views, and then click Add content views. Review the details, and then click Add. In the Content views tab, verify that the status for both content views is Added.

  12. Publish and promote a new version of the BaseHAComposite composite view to the Test lifecycle environment.

    1. Click Publish new version. Click the Promote switch, and select the checkboxes for the Build and Test lifecycles. Click Next. Review the details, and then click Finish. Wait for the process to complete.

  13. Update the serverb content host to use the BaseHAComposite content view in the Test environment of the Finance organization.

    1. 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/FinanceServerBase
    2. In 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 ~]# exit
      logout
      [student@satellite ~]$ exit
      logout
      [student@workstation ~]$ exit
      logout
    3. 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/BaseHAComposite
  14. Verify 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.

    1. 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:   1
    2. Enable 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.
    3. 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-rpms
    4. Return to workstation as the student user.

      [root@serverb ~]# exit
      logout
      [student@serverb ~]$ exit
      logout
      [student@workstation ~]$
  15. 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.

    1. Click ContentContent Views, and then click the FinanceServerBase content view. Click the Filters tab and then click Create filter.

    2. Create a filter with the following details. Verify that the fields are correct, and then click Create filter.

      FieldValue
      NameNon-security Errata
      Content TypeErrata - by date range
      Inclusion TypeExclude
    3. Clear the Security checkbox in the Errata type list.

    4. Select January 1, 2022 in the Start Date field, and then click Edit rule.

    5. Click Publish new version for the FinanceServerBase content view. Enter Added non-security errata in the Description field. Click the Promote switch, and then select the Build and Test checkbox. Click Next. Review the details, and then click Finish. Verify that the new version has fewer packages than the previous content view version.

      Important

      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.

Evaluation

As the student user on the workstation machine, use the lab command to grade your work. Correct any reported failures and rerun the command until successful.

[student@workstation ~]$ lab grade software-review

Finish

On the workstation machine, change to the student user home directory and use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

The lab finish command removes the filter, and then publishes and promotes the modified content views.

[student@workstation ~]$ lab finish software-review

Revision: rh403-6.11-3ad886e