Bookmark this page

Guided Exercise: Synchronize Red Hat Content

Create a sync plan, enable software repositories, create products, and ensure that the products are current in the library.

Outcomes

  • Enable and synchronize available repositories.

  • Set the default download policy to on_demand.

  • Create a sync plan to provide control over the frequency of content synchronizations.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

This command ensures that the satellite host is reachable on the network and prepares it for this exercise.

[student@workstation ~]$ lab start lifecycles-sync

Instructions

Important

To reduce exercise wait time, the initial Satellite classroom environment contains the preconfigured Operations and Finance organizations, each with an imported subscription manifest and presynchronized RHEL 9 BaseOS and AppStream repositories. In this exercise, you practice synchronization by adding a client dnf repository to the Operations organization.

  1. Log in to the Satellite Server 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 Operations.

  3. Enable synchronization of the desired repository from the local CDN.

    Important

    A correct CDN URL value is necessary for successful course operation. If the URL is incorrect, then return to ContentSubscriptions and click Manage Manifest. On the Manage Manifest dialog, click the CDN Configuration tab and update the URL field to http://cdn.lab.example.com.

    1. Click ContentRed Hat Repositories to access the Red Hat Repositories page.

    2. Enter RHEL 9 x86_64 in the Search field, and then click Search.

    3. Verify that the Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) and the Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) repositories are already listed in the Enabled Repositories list on the right side of the web page. The prebuilt classroom environment includes these two RHEL 9 repositories.

    4. In the Available Repositories list, click the greater-than symbol (>) to the left of the Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs) repository to expand the version information. Click the plus sign (+) to the right of x86_64 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.

  4. Verify that the default download policy for repositories is set to on_demand so that Satellite Server downloads only repository metadata during synchronization.

    1. Click AdministerSettings and then click the Content tab.

    2. In the Name column, locate the Default Red Hat Repository download policy entry and ensure that Default Red Hat Repository download policy is set to on_demand. Use the Search field to filter the list, if needed.

  5. Use the Satellite Server web UI to verify that the Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9 and Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9 repositories are already synced.

    1. Click ContentProducts to open the Products page.

    2. Click the Red Hat Enterprise Linux for x86_64 product to view the product's repositories. The Repositories tab is displayed.

    3. Verify that the Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9 and Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9 repositories each state Success in the Sync Status column.

    4. If either repository does not have a Success status, then click the checkbox to the left of the repository name, and then click Sync Now to begin the repository synchronization. The synchronization task runs for several minutes, but you can continue this exercise without waiting for the synchronization to complete.

  6. Use the hammer command to synchronize the Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs repository.

    1. On workstation, log in to the satellite system as the student user and switch to the root user.

      [student@workstation ~]$ ssh student@satellite
      [student@satellite ~]$ sudo -i
      [sudo] password for student: student
      [root@satellite ~]#
    2. List the enabled repositories. Note the numeric identifier of the Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs repository in the command output.

      [root@satellite ~]# hammer repository list \
      --organization Operations --fields Id,Name
      ---|---------------------------------------------------------
      ID | NAME
      ---|---------------------------------------------------------
      22 | Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8
      23 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8
      25 | Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9
      24 | Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9
      30 | Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs
      ---|---------------------------------------------------------
    3. Synchronize the Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs repository by using the repository ID from your previous query.

      [root@satellite ~]# hammer repository synchronize --id 30
      [.......................................................................] [100%]
      Added Rpms: 10, Errata: 1
      Total steps: 30/30
      --------------------------------
      Associating Content: 12/12
      Downloading Artifacts: 0/0
      Downloading Metadata Files: 6/6
      Parsed Advisories: 1/1
      Parsed Comps: 1/1
      Parsed Packages: 10/10
      Un-Associating Content: 0/0
    4. Return to the workstation system as the student user.

      [root@satellite ~]# exit
      logout
      [student@satellite ~]$ exit
      logout
      Connection to satellite closed.
      [student@workstation ~]$
  7. Use the Satellite Server web UI to create a sync plan that checks and updates the content every day at a scheduled time. Assign Red Hat Enterprise Linux for x86_64 product to the sync plan.

    1. In the upper-left corner of the web page, verify that the Operations organization context is set.

    2. Click ContentSync Plans, and then click Create Sync Plan.

    3. Enter Red Hat Products - Operations in the Name field.

    4. Select custom cron in the Interval field.

    5. Enter the current time in the Custom Cron field to synchronize at that time every day. For example, enter 15 18 * * * in the Custom Cron field to synchronize at 18:15 every day.

      Note

      The time values for the Custom Cron field use the 24-hour clock, with the minutes value first, followed by the hour, day, month, and day of the week values.

      Select the current date for the Start Date field.

    6. Click Save to create the sync plan. The Details tab is displayed.

    7. Click the Products tab and then click the Add tab. Select the checkbox next to Red Hat Enterprise Linux for x86_64, and then click Add Selected.

  8. Click MonitorRecurring Logics to verify the recurring task that you created.

    1. Click the ID value in the task's row to view the task's details. Note that tasks can be disabled without being deleted. Verify that the task remains enabled.

    2. Click ContentProducts and then click the Red Hat Enterprise Linux for x86_64 product.

    3. Click the Tasks tab to verify that previous synchronization tasks successfully completed on the product's repositories.

    4. Click the Details tab to view the product's sync status. Verify that the Next Sync field displays a future time for the next occurrence.

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.

[student@workstation ~]$ lab finish lifecycles-sync

Revision: rh403-6.11-3ad886e