7.10. 创建内容过滤器
使用此流程创建内容过滤器。要使用 CLI 而不是 Web UI,请参阅 CLI 过程。
有关如何构建过滤器的示例,请参阅 第 7.9 节 “内容过滤器示例”。
流程
- 在 Satellite Web UI 中,导航到 Content > Content Views 并选择 Content View。
- 导航到 Yum Content > Filters,再单击 New Filter。
- 在 Name 字段中输入过滤器的名称。
- 在 Content Type 列表中,选择您要过滤的内容类型。根据您为新过滤器的内容类型选择的内容,会显示不同的选项。
- 在 Inclusion Type 列表中,选择 Include 或 Exclude。
- 在 Description 字段中输入过滤器的描述,然后点 Save。
- 根据您为 内容类型 输入的内容,添加规则以创建您想要的过滤器。
- 单击 受影响的存储库选项卡,选择哪个特定存储库使用这个过滤器。
- 单击 Publish New Version 以发布过滤的存储库。在 Description 字段中输入更改的描述,然后点 Save。
您可以在所有环境中提升此内容视图。
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