8.11. 创建内容过滤器
使用这个流程创建内容过滤器。有关如何构建过滤器的示例,请参阅 第 8.10 节 “内容过滤器示例”
流程
要创建内容过滤器,请完成以下步骤:
- 在 Satellite Web UI 中,进入到 Content > Content Views 并选择 Content View。
- 导航到 Yum Content > Filters,再点 New Filter。
- 在 Name 字段中输入您的过滤器的名称。
- 在 Content Type 列表中,选择您要过滤的内容类型。根据您为新过滤器的内容类型选择的内容,会显示不同的选项。
- 从 Inclusion Type 列表中,选择 Include 或 Exclude。
- 在 Description 字段中输入过滤器的描述,然后点 Save。
- 根据您为 Content Type 输入的内容,添加规则以创建您想要的过滤器。
- 点 Affected repositories 选项卡选择使用此过滤器的特定存储库。
- 单击 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