内容生命周期管理示例

本节提供了一些常见示例来说明如何使用内容生命周期管理。请使用这些示例来构建您自己的个性化实现。

1. 为每月修补周期创建项目

每月修补周期的示例项目包括:

  • 创建一个按日期过滤器

  • 将过滤器添加到项目

  • 将过滤器应用于新项目构建

  • 从项目中排除补丁

  • 在项目中包含补丁

1.1. 创建一个按日期过滤器

The By Date filter excludes all patches released after a specified date. This filter is useful for your content lifecycle projects that follow a monthly patch cycle.

Procedure: Creating the By Date filter
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. In the Filter Name field, type a name for your filter. For example, Exclude patches by date.

  3. In the Filter Type field, select Patch (Issue date).

  4. In the Matcher field, later or equal is autoselected.

  5. 选择日期和时间。

  6. 单击 保存

1.2. 将过滤器添加到项目

过程:将过滤器添加到项目
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  项目并从列表中选择一个项目。

  2. 单击 关联过滤器/解除过滤器关联 链接以查看所有可用的过滤器

  3. Select the new Exclude patches by date filter.

  4. 单击 保存

1.3. 将过滤器应用于新项目构建

新过滤器已添加到过滤器列表,但仍然需要将其应用于项目。要应用过滤器,需要构建第一个环境。

过程:使用过滤器
  1. 单击 构建 以构建第一个环境。

  2. 可选:添加消息。 可以使用消息来帮助跟踪构建历史记录。

  3. 在测试服务器上使用新通道来检查过滤器是否正常工作。

  4. 单击 升级 将内容移到下一个环境。 如果您有大量过滤器,或者过滤器非常复杂,则构建过程需要较长时间。

1.4. 从项目中排除补丁

测试可以帮助您发现问题。如果发现问题,请排除按日期过滤器之前发布的有问题补丁。

过程:排除补丁
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. In the Filter Name field, enter a name for the filter. For example, Exclude openjdk patch.

  3. In the Filter Type field, select Patch (Advisory Name).

  4. In the Matcher field, select equals.

  5. In the Advisory Name field, type a name for the advisory. For example, SUSE-15-2019-1807.

  6. 单击 保存

  7. 导航到内容生命周期  项目并选择您的项目。

  8. Click Attach/Detach Filters link, select Exclude openjdk patch, and click Save.

When you rebuild the project with the Build button, the new filter is used together with the by date filter we added before.

1.5. 在项目中包含补丁

In this example, you have received a security alert. An important security patch was released several days after the first of the month you are currently working on. The name of the new patch is SUSE-15-2019-2071. You need to include this new patch into your environment.

The Allow filters rule overrides the exclude function of the Deny filter rule. For more information, see 内容生命周期管理.

过程:在项目中包含补丁
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. In the Filter Name field, type a name for the filter. For example, Include kernel security fix.

  3. In the Filter Type field, select Patch (Advisory Name).

  4. In the Matcher field, select equals.

  5. In the Advisory Name field, type SUSE-15-2019-2071, and check Allow.

  6. 单击 保存 以存储该过滤器。

  7. 导航到内容生命周期  项目并从列表中选择您的项目。

  8. Click Attach/Detach Filters, and select Include kernel security patch.

  9. 单击 保存

  10. 单击 构建 以重新构建环境。

2. 更新现有的每月修补周期

每月修补周期完成后,您可以更新下个月的修补周期。

过程:更新每月修补周期
  1. In the by date field, change the date of the filter to the next month. 或者,创建一个新过滤器并更改项目的指派。

  2. Check if the exclude filter for SUSE-15-2019-1807 can be detached from the project. 可能有一个新补丁可以修复此问题。

  3. Detach the allow filter you added previously. 默认已包含该补丁。

  4. 重新构建项目以创建包含下个月补丁的新环境。

3. 通过实时修补增强项目

本节介绍如何设置过滤器以创建可实时修补的环境。

当您准备使用实时修补时,需要注意一些重要事项:

  • 永远只在您的系统上使用一个内核版本。 实时修补软件包与特定内核一起安装。

  • 实时修补更新作为一个补丁交付。

  • Each kernel patch that begins a new series of live patching kernels displays the required reboot flag. 这些内核补丁附带实时修补工具。安装这些补丁后,需要在下一年开始之前至少重引导系统一次。

  • 仅安装与已安装内核版本匹配的在线补丁更新。

  • 在线补丁作为独立补丁提供。 您必须排除内核版本高于当前安装版本的所有常规内核补丁。

3.1. 排除内核版本较高的软件包

In this example you update your systems with the SUSE-15-2019-1244 patch. This patch contains kernel-default-4.12.14-150.17.1-x86_64.

You need to exclude all patches which contain a higher version of kernel-default and kernel-default-base.

过程:排除内核版本较高的软件包
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. In the Filter Name field, type a name for your filter. For example, Exclude kernel greater than 4.12.14-150.17.1.

  3. In the Filter Type field, select Patch (Contains Package).

  4. In the Matcher field, select version greater than.

  5. In the Package Name field, type kernel-default.

  6. Leave the Epoch field empty.

  7. In the Version field, type 4.12.14.

  8. In the Release field, type 150.17.1.

  9. 单击 保存 以存储该过滤器。

  10. 导航到内容生命周期  项目并选择您的项目。

  11. 单击 关联过滤器/解除过滤器关联

  12. Select Exclude kernel greater than 4.12.14-150.17.1, and click Save.

You need to repeat this procedure for the kernel-default-base package.

单击 构建 后,会创建一个新环境。新环境包含版本不高于所安装版本的所有内核补丁。

所有内核版本更高的内核补丁都将被去除。只要实时修补内核不是发行系列中的第一个,它们就仍然可用。

可以使用过滤器模板自动完成此过程。有关如何应用实时修补过滤器模板的详细信息,请参见 administration:content-lifecycle.adoc#filter-templates

4. 切换到实时修补的新内核版本

特定内核版本的实时修补仅可使用一年。一年后,您必须更新系统上的内核。请执行以下环境更改:

过程:切换到新内核版本
  1. 确定要升级到哪个内核版本。 例如:4.12.14-150.32.1

  2. 创建新的内核版本过滤器。

  3. 解除所有历史实时修补过滤器与旧内核的关联。

  4. 关联新的内核版本过滤器。

  5. 单击 构建 以重新构建环境。

    构建完成后,必须立即重新关联以下两个过滤器:

    • Deny patches that contain reboot_suggested keyword

    • Deny patches that contain a package which provides the name installhint(reboot-needed)

新环境包含版本不高于所选新内核版本的所有内核补丁。您需要在系统执行升级后重引导系统。新内核的有效期为一年。在当年安装的所有软件包与当前实时修补内核过滤器匹配。

5. AppStream 过滤器

在内容生命周期管理项目中,您可以使用 AppStream 过滤器将模块化储存库转换为常规储存库。为此,该过滤器会将软件包保留在储存库中,并除去模块元数据。可以在 SUSE Multi-Linux Manager 中像使用常规储存库一样使用转换后的储存库。

因此,要使用 AppStream 储存库,不一定非要完成此过程。

AppStream 过滤器将选择要包含在目标储存库中的单个模块流。您可以添加多个过滤器来选择多个模块流。

如果您不在 CLM 项目中使用 AppStream 过滤器,则模块化源中的模块元数据将保持不变,并且目标储存库包含相同的模块元数据。只要在 CLM 项目中至少启用一个 AppStream 过滤器,所有目标储存库就会转换为常规储存库。

In some cases, you might wish to build regular repositories without having to include packages from any module. To do so, add an AppStream filter using the matcher none (disable modularity). This will disable all the modules in the target repository. This is especially useful for Red Hat Enterprise Linux 9 clients, where the default versions of most modules are already included in the AppStream repository as regular packages.

To use the AppStream filter, you need a CLM project with a modular repository such as Red Hat Enterprise Linux AppStreams. Ensure that you included the module you need as a source before you begin.

过程:使用 AppStream 过滤器
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到您的 Red Hat Enterprise Linux 8 或 9 CLM 项目。 确保已包含项目的 AppStream 通道。

  2. 单击 创建过滤器 并使用以下参数:

    • In the Filter Name field, type a name for the new filter.

    • In the Filter Type field, select Module (Stream).

    • In the Matcher field, select equals.

    • In the Module Name field, type a module name. For example, postgresql.

    • In the Stream field, type the name of the desired stream. For example, 10. If you leave this field blank, the default stream for the module is selected.

  3. 单击 保存 以创建新过滤器。

  4. 导航到内容生命周期  项目并选择您的项目。

  5. 单击 关联过滤器/解除过滤器关联,选择您的新 AppStream 过滤器,然后单击 保存

You can use the browse function in the Create/Edit Filter form to select a module from a list of available module streams for a modular channel.

过程:浏览可用模块流
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到您的 Red Hat Enterprise Linux 8 或 9 CLM 项目。 确保已包含项目的 AppStream 通道。

  2. 单击 创建过滤器 并使用以下参数:

    • In the Filter Name field, type a name for the new filter.

    • In the Filter Type field, select Module (Stream).

    • In the Matcher field, select equals.

  3. Click Browse available modules to see all modular channels.

  4. 选择一个通道以浏览模块和流:

    • In the Module Name field, start typing a module name to search, or select from the list.

    • In the Stream field, start typing a stream name to search, or select from the list.

只能在浏览模块时选择通道。选定的通道不会与过滤器一起保存,并且不会对 CLM 过程产生任何影响。

您可以为要包含在目标储存库中的任何其他模块流创建额外的 AppStream 过滤器。会自动包含选定流所依赖的任何模块流。

请小心不要指定有冲突的、不兼容的或缺失的模块流。例如,从同一个模块中选择两个流是无效的。

过程:禁用模块化
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到您的 Red Hat Enterprise Linux 8 或 9 CLM 项目。 确保已包含项目的 AppStream 通道。

  2. 单击 创建过滤器 并使用以下参数:

    • In the Filter Name field, type a name for the new filter.

    • In the Filter Type field, select Module (Stream).

    • In the Matcher field, select none (disable modularity).

  3. 单击 保存 以创建新过滤器。

  4. 导航到内容生命周期  项目并选择您的项目。

  5. 单击 关联过滤器/解除过滤器关联,选择您的新 AppStream 过滤器,然后单击 保存

这样会有效从目标储存库中去除模块元数据,并排除属于模块的所有软件包。

当您使用 Web UI 中的 构建 按钮构建 CLM 项目时,目标储存库是不包含任何模块的常规储存库,其中包含来自选定模块流的软件包。

在 Red Hat Enterprise Linux 8 项目中完全禁用模块化可能导致环境存在缺陷,因为在 Red Hat Enterprise Linux 8 中,某些模块对于系统的健康运行是不可或缺的。