7.10. 为 Yum 内容创建内容过滤器
您可以过滤包含 Yum 内容的内容视图,以包含或排除特定的软件包、软件包组、勘误表或模块流。过滤器基于 名称、版本 和 架构 的组合。
要使用 CLI 而不是 Satellite Web UI,请参阅 CLI 过程。
有关如何构建过滤器的示例,请参考 第 7.9 节 “内容过滤器示例”。
流程
- 在 Satellite Web UI 中,导航到 Content > Content Views 并选择 Content View。
- 在 Filters 选项卡上,单击 Create filter。
- 输入名称。
- 从 Content type 列表中,选择内容类型。
- 从 Inclusion Type 列表中,选择 Include filter 或 Exclude filter。
- 可选:在 Description 字段中输入过滤器的描述。
- 点 Create filter 创建内容过滤器。
- 根据您为 Content Type 输入的内容,添加规则来创建您想要的过滤器。
- 如果您希望过滤器应用到 存储库子集, 或者 应用到所有存储库。
- 单击 Publish New Version,以发布过滤的存储库。
- 可选:在 Description 字段中输入更改描述。
单击 Create filter 以发布内容视图的新版本。
您可以在所有环境中提升此内容视图。
CLI 过程
向内容视图添加过滤器。使用
--inclusion false
选项将过滤器设置为 Exclude 过滤器:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在过滤器中添加规则:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 发布内容视图:
hammer content-view publish \ --name "Example_Content_View" \ --description "Adding errata filter" \ --organization "My_Organization"
# hammer content-view publish \ --name "Example_Content_View" \ --description "Adding errata filter" \ --organization "My_Organization"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在所有环境中提升视图:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow