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:

  1. In the Satellite web UI, navigate to Content > Content Views and select a Content View.
  2. Navigate to Yum Content > Filters and click New Filter.
  3. In the Name field, enter a name for your filter.
  4. 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.
  5. From the Inclusion Type list, select either Include or Exclude.
  6. In the Description field, enter a description for the filter, and click Save.
  7. Depending on what you enter for Content Type, add rules to create the filter that you want.
  8. Click the Affected repositories tab to select which specific repositories use this filter.
  9. 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

  1. 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"
  2. 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"
  3. Publish the Content View:

    # hammer content-view publish \
    --name "Example_Content_View" \
    --description "Adding errata filter" \
    --organization "My_Organization"
  4. 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"