Bookmark this page

Guided Exercise: Publish and Promote Content Views

Publish a new or modified content view and promote it to a specific lifecycle environment.

Outcomes

  • Create and publish content views.

  • Modify content views.

  • Promote content views.

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-publish

Instructions

Important

Be careful to create the multiple content view versions as instructed in this exercise. You create two versions of one content view, with different content in each version, and publish both versions to a lifecycle path. In a later exercise, you assign each of two content hosts to different lifecycle environments to demonstrate software access control through the content view versions.

If you create a different result than instructed, then edit the content view to create the two specified content versions, and use the resulting version numbers in the later exercise. Promoting a content host version to a lifecycle environment removes all other content host versions from that lifecycle environment. Use that technique to adjust the versions in each lifecycle environment.

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

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

  3. Create the OperationsServerBase content view in the Operations organization.

    1. Click ContentContent Views and then click Create content view to display the Create content view page.

    2. Enter OperationsServerBase in the Name field. Notice that the Label field is autogenerated from the Name field.

    3. Enter Operations server base packages in the Description field, and then click Create content view. The Repositories tab is displayed.

  4. Create version 1.0 of the content view. Select repositories and publish the OperationsServerBase content view version to the Operations organization's Development lifecycle environment.

    1. Select the checkbox for the Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9 repository, and then click Add Repositories to add the selected repository to the content view.

    2. Click Publish new version to display the Publish page.

    3. Enter Operations server base repositories in the Description field, and click Next to display the Review details page.

    4. Click Finish to publish the new content view version. Wait for the publishing process to complete. The time to complete publishing depends on the repository size.

    5. Click Promote to display the Promotion page.

    6. Enter Initial base repositories in the Description field, and select the checkboxes for the Development and QA lifecycle environments.

    7. Set the Promote switch to promote the new content view version. Wait for the environment promotion process to complete. At the end of this process, version 1.0 of the OperationsServerBase content view is promoted through to the QA environment in the Operations organization.

  5. After some initial quality testing, you recognize that additional software from other repositories is needed for the content view's use case. Modify the OperationsServerBase content view to include additional repositories. Publish and promote version 2.0 of the content view to the Development 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 Repositories tab to view the available repositories. 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 click Add Repositories to include the selected repositories in the content view.

    2. Click Publish new version to display the Publish page. The version is now 2.0. Enter Initial base repositories expanded in the Description field.

    3. Set the Promote switch to display the lifecycle environments. Select the Development checkbox. Click Next to display the Review details page.

    4. Click Finish to publish the new content view version. Wait for the publishing process to complete. At the end of this process, version 1.0 of the OperationsServerBase content view is promoted to the Development and QA environments in the Operations organization, and version 2.0 is promoted only to the Development environment.

  6. In the web UI, view the differences between the two content view versions.

    1. Click ContentContent Views, and then click OperationsServerBase to display content view attributes. The Versions column lists the lifecycle environments that are associated with the content view. Notice the different versions and the difference in the number of packages. The Version 2.0 content view has more packages than the Version 1.0 content view.

    2. Click Version 1.0 to view the attributes for that content view version. Version 1.0 contains only the Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9 repository.

    3. Click the Versions tab, and then click Version 2.0. Verify that version 2.0 contains Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9, Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9, and Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs repositories.

  7. In the web UI, enable and synchronize the following RHEL 9 repositories for the Marketing organization, to prepare for creating a content view.

    • Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)

    • Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)

    • Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)

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

    2. Click ContentRed Hat Repositories to display the Red Hat Repositories page. Enter RHEL 9 x86_64 in the Search field, and then click Search.

    3. In the Available Repositories list, click the greater-than symbol (>) to the left of the Red Hat Enterprise Linux 9 for x86_64 - BaseOS (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 repository is in the Enabled Repositories list and that the repository is for RHEL 9.

    4. In the Available Repositories list, click the greater-than symbol (>) to the left of the Red Hat Enterprise Linux 9 for x86_64 - AppStream (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 repository is in the Enabled Repositories list and that the repository is for RHEL 9.

    5. 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 repository is in the Enabled Repositories list and that the repository is for RHEL 9.

    6. Click ContentProducts to display the Products page. Select the checkbox next to the Red Hat Enterprise Linux for x86_64 product. From the Select Action list, select Sync Selected.

    7. Click Click to monitor task progress. in the popup message and wait for the task to complete.

  8. Using the hammer command, create the MarketingServerBase content view in the Marketing organization, add repositories, publish the content view version, and promote the content view version to the Development and QA environments.

    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 repositories in the Marketing organization. Note the repository ID for the RHEL 9 Client repository.

      [root@satellite ~]# hammer repository list \
      --organization Marketing --fields Id,Name
      ---|---------------------------------------------------------
      ID | NAME
      ---|---------------------------------------------------------
      52 | Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9
      51 | Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9
      32 | Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs
      ---|---------------------------------------------------------
    3. Create the MarketingServerBase content view in the Marketing organization. Add the three repositories that you discovered in the previous query by including their repository IDs as a comma-delimited list.

      [root@satellite ~]# hammer content-view create \
      --organization Marketing --name MarketingServerBase \
      --description "Marketing server base repositories" \
      --repository-ids 32,51,52
      Content view created.
    4. Publish the MarketingServerBase content view version to the Library environment and promote the version to the Development and QA lifecycle environments.

      [root@satellite ~]# hammer content-view publish \
      --organization Marketing --name MarketingServerBase \
      --description "Initial base repositories" \
      --lifecycle-environments Development,QA
      [....................................................................] [100%]
    5. View the published content views that are available to the Marketing organization.

      [root@satellite ~]# hammer content-view list \
      --organization Marketing \
      --fields Name,"Last Published","Repository Ids"
      --------------------------|---------------------|---------------
      NAME                      | LAST PUBLISHED      | REPOSITORY IDS
      --------------------------|---------------------|---------------
      Default Organization View | 2023/02/04 23:50:04 |
      MarketingServerBase       | 2023/02/05 03:24:28 | 32,51,52
      --------------------------|---------------------|---------------
    6. View the Marketing organization's lifecycle environments where the MarketingServerBase content view is available.

      [root@satellite ~]# hammer content-view version list \
      --organization Marketing --content-view MarketingServerBase \
      --fields Name,Description,"Lifecycle Environments"
      ------------------------|---------------------------|-------------------------
      NAME                    | DESCRIPTION               | LIFECYCLE ENVIRONMENTS
      ------------------------|---------------------------|-------------------------
      MarketingServerBase 1.0 | Initial base repositories | Library, Development, QA
      ------------------------|---------------------------|-------------------------
    7. Return to the workstation system as the student user.

      [root@satellite ~]# exit
      logout
      [student@satellite ~]$ exit
      logout
      Connection to satellite closed.
      [student@workstation ~]$

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-publish

Revision: rh403-6.11-3ad886e