Red Hat Training

A Red Hat training course is available for Red Hat Satellite

Chapter 11. Managing OSTree Content

OSTree is a tool to manage bootable, immutable, versioned file system trees. You can use any build system you like to place content into it on a build server then export an OSTree repository to a static HTTP. Red Hat Enterprise Linux Atomic Server uses OSTree content composed from RPM files as a method to keep the operating system up to date.

The Red Hat Satellite 6 offers tools to synchronize and manage OSTree branches from an OSTree repository.

11.1. Configuring OSTree Management on the Satellite Server

In Satellite Server 6.2, OSTree management tools are not installed and enabled by default. You need to run satellite-installer to install the required packages and to configure the tools.

Prerequisites

  • Ensure you are on the latest minor version to prevent package version conflicts.

To Enable OSTree Tools:

As the root user, enter the following command:

# satellite-installer --katello-enable-ostree=true

The installer downloads the required packages (ostree, pulp-ostree-plugins, and tfm-rubygem-katello_ostree) and configures your Satellite Server to use OSTree management tools.

11.2. Selecting Red Hat OSTree Content to Synchronize

Red Hat’s CDN provides OSTree Content for you to select and synchronize.

For Web UI Users

Navigate to Content > Red Hat Repositories. This displays a set of tabs for different content types. Select the OSTree tab. Scroll down to the OSTree set you aim to use. For our example, we will import the Red Hat Enterprise Linux Atomic Host Trees set from the Red Hat Enterprise Linux Atomic Host product group. Ensure you have a repository enabled.

Navigate to Content > Products and click on the Red Hat Enterprise Linux Atomic Host. This product now includes a repository for our Red Hat Enterprise Linux Atomic Host Trees branch set. Select this repository and click Sync Now.

Note

You can also view the progress of the synchronization in the Web UI. Navigate to Content > Sync Status and expanding the Product/Repository tree (or click Expand All).

After a few minutes, the Satellite Server completes the import of all images relating to the rhel7 repository.

For CLI Users

Search the Red Hat Enterprise Linux Server product for ostree repositories:

# hammer repository-set list \
--product "Red Hat Enterprise Linux Atomic Host" \
--organization "ACME" | grep "ostree"

Enable the ostree repository for Red Hat Enterprise Linux Atomic Host. In our example, the ID for this repository is 3822:

# hammer repository-set enable \
--product "Red Hat Enterprise Linux Atomic Host" \
--name "Red Hat Enterprise Linux Atomic Host (Trees)" \
--organization "ACME"

Find and synchronize the repository in our product. In our example, the ID for our version of the repository is 5:

# hammer repository list \
--product "Red Hat Enterprise Linux Atomic Host" \
--organization "ACME"
# hammer repository synchronize \
--name "Red Hat Enterprise Linux Atomic Host Trees" \
--product "Red Hat Enterprise Linux Atomic Host" \
--organization "ACME"

11.3. Importing Custom OSTree Content

In addition to importing OSTree content from Red Hat’s CDN, Red Hat Satellite 6 also imports content from other sources. This requires a published HTTP location for the OSTree to import.

For Web UI Users

Navigate to Content > Products and click New Product. A form for a new Product appears. Enter the following details:

  • Name - The plain text name for the product. Enter OSTree Content.
  • Label - An internal ID for the product. Red Hat Satellite 6 automatically completes this field based on what you have entered for Name.
  • GPG Key - The GPG Key for the entire product. Leave this blank.
  • Sync Plan - A synchronization plan for the product. We can attach this to our Example Plan.
  • Description - A plain text description of the product. Enter OSTree Content.

Click Save.

After creating the custom product for Fedora, the product’s repositories screen appears. Click Create Repository, which displays a form for a new repository. Enter the following details:

  • Name - A plain text name for the repository. Enter Custom OSTree.
  • Label - An internal ID for the repository. Red Hat Satellite 6 automatically completes this field based on what you have entered for Name.
  • Type - The type of repository. Select ostree. A new field appears for the URL.
  • URL - The URL of the registry to use as a source. For example http://www.example.com/rpm-ostree/.

Click Save. We return to the product’s repository screen with our new repository listed. Select it and click Sync Now to start the synchronization process. After the a few minutes, the Satellite Server completes the synchronization.

Note

You can also view the progress of the synchronization in the Web UI. Navigate to Content > Sync Status and expanding the Product/Repository tree (or click Expand All).

For CLI Users

Create the custom OSTree Content product:

# hammer product create \
--name "OSTree Content" \
--sync-plan "Example Plan" \
--description "OSTree Content" \
--organization "ACME"

Create the repository for the OSTree:

# hammer repository create \
--name "Custom OSTree" \
--content-type "ostree" \
--url "http://www.example.com/rpm-ostree/" \
--product "OSTree Content" \
--organization "ACME"

Then synchronize the repository:

# hammer repository synchronize \
--name "Custom OStree" \
--product "OSTree Content" \
--organization "ACME"

Now we have a synchronized set of OSTree branches.

11.4. Managing OSTree Content with Content Views

Use content views to manage OSTree branches across the application life cycle. This process uses the same publication and promotion method that RPMs and Puppet modules use.

For Web UI Users

Navigate to Content > Content Views and click Create New View. This displays a form for View Details. Enter the following information:

  • Name - The plain text name for the view. Enter OSTree.
  • Label - An internal ID for the view. Red Hat Satellite 6 automatically completes this field based on what you have entered for Name.
  • Description - A plain text description of the view. Enter OSTree branches for Red Hat Enterprise Atomic Host.
  • Composite View? - Defines whether to use a Composite Content View. Leave this option deselected.

Click Save to complete.

This creates a new content view entry. Navigate to the OSTree Content subtab, then click Add. Select the OSTree repository for our Red Hat Enterprise Linux Atomic Host Trees. Click Add Repository. This adds the OSTree content from this repository to the content view.

Our content view is ready to publish. Navigate to Versions and click Publish New Version. The Satellite Server provides some details about the new version (Version 1) and allows you to enter a Description for the version, which is useful to logging changes for new content versions. Enter Initial content view for our OSTree and click Save.

The Satellite Server creates the new version of the view and publishes it to the Library environment.

You can also click Promote to promote this content view across environments in the application life cycle.

For CLI Users

Obtain a list of repository IDs:

# hammer repository list --organization "ACME"

For our example, the OSTree repository uses 5 for its IDs. Create the content view and add the repository:

# hammer content-view create \
--name "OSTree" \
--description "OSTree for Red Hat Enterprise Linux Atomic Host" \
--repository-ids 5 \
--organization "ACME"

Now publish the view:

# hammer content-view publish \
--name "OSTree" \
--description "Initial content view for our OSTree" \
--organization "ACME"

The Satellite Server creates the new version of the view and publishes it to the Library environment.

11.5. Chapter Summary

This chapter provided a basic overview of managing OSTree content in Red Hat Satellite 6, including how to import and synchronize your OSTree content from Red Hat and custom sources. This chapter also showed how to manage this content across the application life cycle.

The next chapter examines how to manage ISO files.