Content Views

The content views page can be accessed via the content menu:

Content > Content Views

The content views page forms a part of orcharhino’s content management.

A content view is a named (and versioned) collection of (local) orcharhino repositories. In order to add any repositories to a content view, those repositories must first be added to (and synchronized with) orcharhino using the products page.

It is possible to add any number of repositories (of any number of repository types) from any number of products to any given content view. Once any desired repositories have been added to a new content view, it is necessary to publish (a new version) of that content view. This will create a fixed snapshot of the repositories contained in the content view, as they were at the time of publication. (Subsequent synchronisations of the underlying repositories with their remote sources, will not affect such snapshots).

The first publication of a content view, is referred to as "version 1.0" of that content view, and the major version number is iterated for subsequent publications (2.0, 3.0, etc). The publication of newer versions of a content view, is the only way for content views to reflect changes (newer synchronisations) to the underlying repositories contained within.

It is also possible to apply errata to some published version of a content view. Doing so will create minor versions of the content view (1.1, 1.2, 2.1, etc).

The purpose of such versioning is to create stable software sets for the distribution to hosts. Ultimately each host will be associated with a single content view, such that this view must contain all the repositories needed by the registered hosts. However, it is possible to create composite content views by combining existing content views. (Hosts can then be registered to a composite content view aggregating everything those hosts might need.)

The version of a content view delivered to a given host registered to the view depends on the lifecycle environment the host is in. The mechanism employed to register hosts with a given view involves the use of activation keys.

Content View Filters

Content view filters allow you to filter repositories based on exclude and include rules. They accept repositories as input and will alter a content view.

One use case is to exclude all packages without any errata. You may also only include packages in a specific version or exclude any versions older than a specific version. This helps excluding outdated and potentially unwanted vulnerable packages.

Content View Filters for deb Content

Content views containing deb content can be filtered to include or exclude specific packages or package groups. Filters are based on a combination of the name and the architecture.

  1. Navigate to Content > Content Views and select a content view that you want to apply a filter on.

  2. Select Filters (1) on the Deb Content tab.

    Creating a new content view filter for deb content
  3. Click the New Filter button (2) as shown above.

  4. Add a new filter for deb content:

    Adding a new filter to exclude packages from a content view
    • The Name field (1) allows you to name the new filter.

    • The Inclusion Type drop down menu (2) allows you to exclude or include content based on the rules of the filter.

    • The Description field (3) allows you to add an arbitrary description to the filter.

    • Click the Save button (4) to save the filter.

  5. Add rules to the newly created content view filter:

    Adding rules to exclude specific packages by name
    • The Add Rule button (1) allows you to create a rule.

    • The Remove Rule button (2) allows you to remove an existing rule from the selected filter.

    • The DEB Name field (3) refers to the name of the package, e.g. emacs*. Optionally, add an asterisk (*) to select packages irrespective of their full name.

    • The Architecture field (4) refers to the architecture of the package, e.g. amd64. There is an autocomplete feature for both the name and the architecture fields.

    • The Save button (5) allows you to save the newly created rule to the filter.

    • The Edit button (6) allows you to edit an existing rule.

    • Clicking the Show Matching Content button (7) displays a list of packages matching the selected rule.

  6. Publish a new version of the content view to make the filtered repositories consumable by clients.

Content View Filters for yum Content

Content views containing yum content can be filtered to include or exclude specific packages, package groups, errata, or module streams. Filters are based on a combination of the name, version, and architecture.

  1. Navigate to Content > Content Views and select a content view that you want to apply a filter on.

  2. Select Filters (1) on the Yum Content tab.

    Creating a new content view filter for yum content
  3. Click the New Filter button (2) as shown above.

  4. Add a new filter for yum content:

    Adding a new filter to exclude packages from a content view
    • The Name field (1) allows you to name the new filter.

    • The Content Type drop down menu (2) refers to the content type of the yum filter. This can be either Package, Package Group, Erratum - by ID, Erratum - Date and Time, or Module Stream.

    • The Inclusion Type drop down menu (3) allows you to exclude or include content based on the rules of the filter.

    • The Description field (4) allows you to add an arbitrary description to the filter.

    • Click the Save button (5) to save the filter.

  5. Add rules to the newly created content view filter:

    Adding rules to exclude specific packages by name
    • The Add Rule button (1) allows you to create a rule.

    • The Remove Rule button (2) allows you to remove an existing rule from the selected filter.

    • The RPM Name field (3) refers to the name of the package, e.g. apache*. Optionally, add an asterisk (*) to select packages irrespective of their full name.

    • The Architecture field (4) refers to the architecture of the package, e.g. amd64. There is an autocomplete feature for both the name and the architecture fields.

    • The Version field (5) refers to the version of the package. Apart from entering the exact version, this field also allows for ranges of versions or versions greater or lower than a specific version.

    • The Save button (6) allows you to save the newly created rule to the filter.

    • The Edit button (7) allows you to edit an existing rule.

    • Clicking the Show Matching Content button (8) displays a list of packages matching the selected rule.

  6. Publish a new version of the content view to make the filtered repositories consumable by clients.

Exporting Content Views via Hammer CLI

Exporting content views on one orcharhino and importing them on another allows you to provide the exact same content view on multiple orcharhino instances. This can be of particular interest if the orcharhino cannot access the internet, as the exported .tar file can be transferred in an arbitrary manner to the other orcharhino.

Run the following command to view a list of available content views:

hammer content-view version list

Note the ID from the first column.

Export a content view by running the following command:

hammer content-view version export --export-dir /path/to/export/ --id 1234

Make sure there is enough space available in the specified path where the exported content view will be saved. We recommend using /var/lib/pulp/katello-export/ to avoid any SELinux issues.

This will create a file called export-<content_view_name>-<content_view_version>.tar.

The .tar file contains all repositories that are associated to the content view.

Importing Content Views via Hammer CLI

The following command allows you to import a previously exported content view and assign it to the given organization:

hammer content-view version import --export-tar /path/to/export.tar --organization-id 5678

This will recreate the content view including all packages and errata. It will use the same major and minor version numbering as the original.

You need to create the required products, repositories, and content view by hand before starting the import. This also includes the association between content view and product.


Possible Issue with many Content Views

In case your orcharhino holds many content views, you might have to enhance the number of entries listed by page in hammer:

hammer settings set --name entries_per_page --value 1000

This will set the value to 1000 entries.