8.11. Creating a Content Filter
Use this procedure to create a content filter. For examples of how to build a filter, see 「Content Filter Examples」.
Procedure
To create a content filter, complete the following steps:
- In the Satellite web UI, navigate to Content > Content Views and select a Content View.
- Navigate to Yum Content > Filters and click New Filter.
- In the Name field, enter a name for your filter.
- From the Content Type list, select the content type that you want to filter. Depending on what you select for the new filter’s content type, different options appear.
- From the Inclusion Type list, select either Include or Exclude.
- In the Description field, enter a description for the filter, and click Save.
- Depending on what you enter for Content Type, add rules to create the filter that you want.
- Click the Affected repositories tab to select which specific repositories use this filter.
- Click Publish New Version to publish the filtered repository. In the Description field, enter a description of the changes, and click Save.
You can promote this Content View across all environments.
For CLI Users
Add a filter to the Content View. Use the
--inclusion false
option to set the filter to an Exclude filter:# hammer content-view filter create \ --name "Errata Filter" \ --type erratum --content-view "Example_Content_View" \ --description "My latest filter" \ --inclusion false \ --organization "My_Organization"
Add a rule to the filter:
# hammer content-view filter rule create \ --content-view "Example_Content_View" \ --content-view-filter "Errata Filter" \ --start-date "YYYY-MM-DD" \ --types enhancement,bugfix \ --date-type updated \ --organization "My_Organization"
Publish the Content View:
# hammer content-view publish \ --name "Example_Content_View" \ --description "Adding errata filter" \ --organization "My_Organization"
Promote the view across all environments:
# hammer content-view version promote \ --content-view "Example_Content_View" \ --version 1 \ --to-lifecycle-environment "Development" \ --organization "My_Organization" # hammer content-view version promote \ --content-view "Example_Content_View" \ --version 1 \ --to-lifecycle-environment "Testing" \ --organization "My_Organization" # hammer content-view version promote \ --content-view "Example_Content_View" \ --version 1 \ --to-lifecycle-environment "Production" \ --organization "My_Organization"