Chapter 2. Using content templates to apply system patches


Content templates filter the errata that can be applied to registered systems in the Hybrid Cloud Console. They also provide filtering and control on the systems themselves. In addition, you can use the same set of content to build custom images in Insights.

Content templates include product and architecture attributes. These attributes, plus a date that you select, create a defined set of packages and errata that you can use to build images, report on patching status, and control the content delivered to your registered systems. All content templates include base RHEL repositories, and you can choose to include additional Red Hat and custom repositories.

2.1. About repository snapshots

Repository snapshots capture the state of your repository at a point in time. Repositories are collections of Red Hat Package Manager files (RPMs) and metadata.

A content template consists of a set of repository snapshots that have the same version of Red Hat Enterprise Linux and the same system architecture. You select the snapshots to ensure that your systems have access only to specific package versions. Using the content templates, you can establish date-based patch baselines for your systems, and then use yum or dnf to perform updates to the systems.

2.2. About snapshots

Snapshots are daily reference copies of the state of your repository at specified points in time. Insights for Red Hat Enterprise Linux takes snapshots of the common RHEL repositories as well as your custom repositories.

You can view the list of snapshots for the repositories that you select, as well as the changes that occur in time between one snapshot and the next. For example, you can see when new packages have been added between snapshots.

2.3. About content templates

A content template consists of an explicit set of packages and errata that can be installed or updated on any associated system. It contains a set of repository snapshots that have the same RHEL product/version, system architecture, and template creation date.

When you associate a system with a content template, Insights overwrites the repository definitions on the system to point to the repository snapshots in the template. These are the same repository snapshots that appear on the Repositories page in the Hybrid Cloud Console. Once you associate a system with a content template, any yum or dnf commands that you run on that system are constrained to the updates included in those repository snapshots. For more information about the Repositories page, see Managing repositories to build your customized operating systems.

For example, you can create or edit a content template to contain only snapshots of Red Hat Enterprise Linux 9 for x86_64 repositories. You can use that content template to apply consistent patches to other systems in your inventory that match the product/version and architecture. Once you associate a content template with a set of systems, you can run dnf at the command line to easily perform consistent updates to all systems associated with that template.

Systems in your inventory that are not associated with that template do not receive the update packages and errata.

Systems that you can associate with a content template must meet the following criteria:

  • Must run RHEL 8 or later. The RHEL version must match the version specified in the template.
  • Registered with Insights, but not managed by Red Hat Satellite or Red Hat Update Infrastructure (RHUI).
  • Must have a system architecture that matches that specified in the template.
  • Must not have a release version set. To ensure that the release version is not set, run the following command as root:

    subscription-manager release --unset
    Copy to Clipboard Toggle word wrap

2.4. Patching RHEL systems with content templates

Content templates help you to apply consistent updates to all the systems assigned to the same template. This approach separates content management from remediation, and allows for more flexibility in patching. You can even use automation tools, such as Ansible Automation Platform, to perform patching operations for you.

You need the following administrator permissions to use content templates:

  • Repositories administrator (read, write, upload)
  • Content template administrator (read repositories, read and write templates)

To view your permissions, navigate to your profile > My User Access > Users. Click your account name. The list of groups for which you have permission displays.

To see the permissions you have within a group, click the group name. The group page displays and shows the types of permissions available (for example, read and write).

For more information about administrator permissions, refer to Predefined User Access roles in the User Access Configuration Guide for Role-based Access Control (RBAC)

2.4.1. How patching works with content templates

The workflow for patching with content templates follows these steps:

  1. You create the content template in Insights for Red Hat Enterprise Linux. The template includes the RHEL version, system architecture, template creation date, and other criteria. Systems that use the content template must match these criteria.
  2. You associate systems with the template. The template points the repositories to snapshots for system updates. Note that the systems can only receive updates through the content template after you associate them.
  3. When a system checks in to Insights, it can discover installable updates. The updates match the criteria in the content template. All systems that are associated with the template discover the same updates. This ensures that all the systems using the template receive consistent updates.
Note

A system can be associated to only one content template at a time.

2.5. Managing content templates

A content template is a set of repository snapshots you have selected to ensure your systems only have access to specific package versions. Using the content templates, you can establish date-based patch baselines for your systems and perform updates of your systems using yum or dnf.

2.5.1. Creating a content template

You can create a content template to ensure your system retains access to specific package versions.

Important

Content templates currently support only major RHEL versions (RHEL 8, 9, or 10). When you create or edit a content template, select a major RHEL version from the drop-down menu for OS Version. Extended support (EUS) subscriptions can show minor RHEL versions in the drop-down menu. However, content templates do not support minor RHEL versions at this time.

Prerequisites

Procedure

  1. Access Red Hat Insights in the Hybrid Cloud Console. Click Content Templates.
  2. Click Add content template. The Create content template wizard opens.
  3. In the Content section complete the following:

    1. On the Define content page, select the architecture and the major OS version of your system. Click Next.
    2. On the Red Hat repositories page, select repositories you want to include in the template. Click Next.
    3. On the Custom Repositories page, select repositories you want to include in the template. Click Next.

      Note

      Only repositories with enabled snapshot functionality are displayed in the list of repositories.

  4. On the Set snapshot date page, select:

    Use latest content
    To use the latest content from the repository during image building. Click Next.
    Use a snapshot

    To use a repository snapshot. Select the date and then click Next.

    Note, if your repository does not have the required snapshot, it chooses the earliest possible snapshot to the date of your choice.

  5. On the Detail page, provide a name for your template. Optionally, provide a description of your template. Click Next.
  6. On the Review page, verify the details about the template and click Create template and add to systems. Assign template to systems opens.

    Optional: Click Create template only if you want to assign this template to systems later.

  7. Select all the systems you want to assign the template to and click Assign.

    This change updates the /etc/yum.repos.d/redhat.repo file on the selected systems. All changes affect your systems every four hours. If you want this change to affect your systems immediately, you must manually refresh subscription-manager on the selected system:

    # subscription-manager refresh
    Copy to Clipboard Toggle word wrap

Verification

  1. Go to Services Red Hat Enterprise Linux Content Templates and verify your template is added to the list of templates.
  2. On your system, check that the /etc/yum.repos.d/redhat.repo file contains https://cert.console.redhat.com.

2.5.2. Editing a content template

You can modify the snapshot date for your content template, assign your content template to more systems, and delete your content template.

Important

Content templates currently support only major RHEL versions (RHEL 8, 9, or 10). When you create or edit a content template, select a major RHEL version from the drop-down menu for OS Version. Extended support (EUS) subscriptions can show minor RHEL versions in the drop-down menu. However, content templates do not support minor RHEL versions at this time.

Prerequisites

  • You have a RHEL subscription.
  • You have Organization Administrator or Content Template administrator permissions.
  • The custom repositories that you want to include in the template have snapshots.

Procedure

  1. Access Insights on the Hybrid Cloud Console. Click Content Templates.
  2. Select the content template you want to edit and choose an action from the following options:

    • To edit repositories, snapshot date, and the name of your content template, go to Actions Edit and follow the Edit content template wizard.

      Note, if you edit a snapshot date for the template, it sets a new baseline for patching, and the systems start using the new snapshot.

    • To assign this template to more systems, go to Systems, click Assign template to systems and select the systems you want to assign this template to. Click Assign.
    • To delete the content template, go to Actions Delete.

Procedure

  1. Navigate to Content > Templates and select a content template from the list. The information page for the template displays.
  2. Select Advisories under the Content tab. The list contains all advisories that apply to systems associated with that content template.
  3. Optional: To filter advisories, select the criterion you want to use from the drop-down menu (Name/Synopsis, Type, or Severity), and then use the second drop-down to select the filter. For example, you can view advisories by severity, and then filter the list to show only the Critical and Important advisories.

2.7. Installing updates

Content templates help you to apply consistent updates to all the systems assigned to the same template. This approach separates content management from remediation, and allows for more flexibility in patching. You can even use automation tools, such as Ansible Automation Platform, to perform patching operations for you.

Note

RHEL 8 supports both the dnf and yum update commands. RHEL 9 and later support only dnf for updates.

Prerequisites

  • You have root access to the system (or systems) that you want to update.
  • You have set up your repositories and snapshots.
  • You have created content templates and assigned systems to them.
  • Updates are available for systems associated with the content template.

Procedure

  1. At the command line, type dnf update.

    # dnf update
    Copy to Clipboard Toggle word wrap

    This installs the updates to the system. The system receives only the updates associated with the content template. For example, if your content template has systems running RHEL 9, then the updates install only on RHEL 9 systems. Systems in your inventory that have different operating system versions or system architectures remain unaffected.

  2. Repeat the update on each of the other systems associated with the same content template.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat