Search

Chapter 6. Importing Custom Content

download PDF

This chapter outlines how you can import custom content of different types to Satellite. If you want to import ISOs, Puppet modules, or different content types to Satellite, it is done with largely the same procedures in this chapter.

For example, you can use the following chapters for information on specific types of custom content but the underlying procedures are the same:

6.1. Using Custom Products in Satellite

Both Red Hat content and custom content in Satellite have similarities:

  • The relationship between a product and its repositories is the same and the repositories still require synchronization.
  • custom products require a subscription for clients to access, similar to subscriptions to Red Hat Products. Satellite creates a subscription for each custom product you create.

For more information about creating and packaging RPMs, see the RPM Packaging Guide in the Red Hat Enterprise Linux documentation.

6.2. Importing Custom SSL Certificates

Before you create custom content, ensure that you import any custom SSL certificates that you require.

If you require SSL certificates and keys to download RPMs, you can add them to Satellite.

  1. In the Satellite web UI, navigate to Content > Content Credentials. In the Content Credentials window, click Create Content Credential.
  2. In the Name field, enter a name for your SSL certificate.
  3. From the Type list, select SSL Certificate.
  4. In the Content Credentials Content field, paste your SSL certificate, or click Browse to upload your SSL certificate.
  5. Click Save.

6.3. Importing a Custom GPG Key

Before you create custom content, ensure that you import any GPG keys that you require.

Prerequisites

  1. Download a copy of the version specific repository package to your client system:

    $ wget http://www.example.com/9.5/example-9.5-2.noarch.rpm
  2. Extract the RPM file without installing it:

    $ rpm2cpio example-9.5-2.noarch.rpm | cpio -idmv

The GPG key is located relative to the extraction at etc/pki/rpm-gpg/RPM-GPG-KEY-EXAMPLE-95.

Procedure

To import a GPG key, complete the following procedure:

  1. In the Satellite web UI, navigate to Content > Content Credentials and in the upper-right of the window, click Create Content Credential.
  2. Enter the name of your repository and select GPG Key from the Type list.
  3. Either paste the GPG key into the Content Credential Contents field, or click Browse and select the GPG key file that you want to import.

    If your custom repository contains content signed by multiple GPG keys, you must enter all required GPG keys in the Content Credential Contents field with new lines between each key, for example:

    -----BEGIN PGP PUBLIC KEY BLOCK-----
    
    mQINBFy/HE4BEADttv2TCPzVrre+aJ9f5QsR6oWZMm7N5Lwxjm5x5zA9BLiPPGFN
    4aTUR/g+K1S0aqCU+ZS3Rnxb+6fnBxD+COH9kMqXHi3M5UNzbp5WhCdUpISXjjpU
    XIFFWBPuBfyr/FKRknFH15P+9kLZLxCpVZZLsweLWCuw+JKCMmnA
    =F6VG
    -----END PGP PUBLIC KEY BLOCK-----
    
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    
    mQINBFw467UBEACmREzDeK/kuScCmfJfHJa0Wgh/2fbJLLt3KSvsgDhORIptf+PP
    OTFDlKuLkJx99ZYG5xMnBG47C7ByoMec1j94YeXczuBbynOyyPlvduma/zf8oB9e
    Wl5GnzcLGAnUSRamfqGUWcyMMinHHIKIc1X1P4I=
    =WPpI
    -----END PGP PUBLIC KEY BLOCK-----
  4. Click Save.

For CLI Users

  1. Copy the GPG key to your Satellite Server:

    $ scp ~/etc/pki/rpm-gpg/RPM-GPG-KEY-EXAMPLE-95 root@satellite.example.com:~/.
  2. Upload the GPG key to Satellite:

    # hammer gpg create \
    --key ~/RPM-GPG-KEY-EXAMPLE-95 \
    --name "My_Repository" \
    --organization "My_Organization"

6.4. Creating a Custom Product

Use this procedure to create a custom product that you can then add repositories to.

Procedure

To create a custom product, complete the following procedure:

  1. In the Satellite web UI, navigate to Content > Products, click Create Product.
  2. In the Name field, enter a name for the product. Satellite automatically completes the Label field based on what you have entered for Name.
  3. Optional: From the GPG Key list, select the GPG key for the product.
  4. Optional: From the SSL CA Cert list, select the SSL CA certificate for the product.
  5. Optional: From the SSL Client Cert list, select the SSL client certificate for the product.
  6. Optional: From the SSL Client Key list, select the SSL client key for the product.
  7. Optional: From the Sync Plan list, select an existing sync plan or click Create Sync Plan and create a sync plan for your product requirements.
  8. In the Description field, enter a description of the product.
  9. Click Save.

For CLI Users

To create the product, enter the following command:

# hammer product create \
--name "My_Product" \
--sync-plan "Example Plan" \
--description "Content from My Repositories" \
--organization "My_Organization"

6.5. Adding Custom RPM Repositories

Use this procedure to add custom RPM repositories in Satellite.

The Products window in the Satellite web UI also provides a Repo Discovery function that finds all repositories from a URL and you can select which ones to add to your custom product. For example, you can use the Repo Discovery to search, for example, http://yum.postgresql.org/9.5/redhat/ and list all repositories for different Red Hat Enterprise Linux versions and architectures. This helps users save time importing multiple repositories from a single source.

Support for Custom RPMs

Red Hat does not support the upstream RPMs directly from third-party sites. These RPMs are used to demonstrate the synchronization process. For any issues with these RPMs, contact the third-party developers.

Procedure

  1. In the Satellite web UI, navigate to Content > Products and select the product that you want to use, and then click Create Repository.
  2. In the Name field, enter a name for the repository. Red Hat Satellite 6 automatically completes the Label field based on what you have entered for Name.
  3. From the Type list, select the type of repository. You can select either a repository for RPM files (yum), Puppet modules (puppet), or Docker images (docker).
  4. In the URL field, enter the URL of the external repository to use as a source.
  5. From the Download Policy list, select the type of synchronization Satellite Server performs.
  6. Ensure that the Mirror on Sync check box is selected. This ensures that the content that is no longer part of the upstream repository is removed during synchronization.
  7. From the Checksum list, select the checksum type for the repository.
  8. Optional: If you want, you can clear the Publish via HTTP check box to disable this repository from publishing through HTTP.
  9. Optional: From the GPG Key list, select the GPG key for the product.
  10. Click Save.

If you want to perform an immediate synchronization, in your product window, click Sync Now.

For CLI Users

  1. Enter the following command to create the repository:

    # hammer repository create \
    --name "My_Repository" \
    --content-type "yum" \
    --publish-via-http true \
    --url http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/ \
    --gpg-key "My_Repository" \
    --product "My_Product" \
    --organization "My_Organization"
  2. Synchronize the repository:

    # hammer repository synchronize \
    --name "My_Repository" \
    --product "My Product" \
    --organization "My_Organization"

6.6. Uploading Content to Custom RPM Repositories

You can upload individual RPMs and source RPMs to custom RPM repositories. You can upload RPMs using the Satellite web UI or the Hammer CLI. You must use the Hammer CLI to upload source RPMs.

Procedure

  1. In the Satellite web UI, click Content > Products.
  2. Click the name of the custom product.
  3. In the Repositories tab, click the name of the custom RPM repository.
  4. Under Upload Package, click Browse…​ and select the RPM you want to upload.
  5. Click Upload.

To view all RPMs in this repository, click the number next to Packages under Content Counts.

For CLI Users

  • Enter the following command to upload an RPM:

    # hammer repository upload-content \
    --id repo_ID \
    --path /path/to/example-package.rpm
  • Enter the following command to upload a source RPM:

    # hammer repository upload-content \
    --content-type srpm \
    --id repo_ID \
    --path /path/to/example-package.src.rpm

    When the upload is complete, you can view information about a source RPM by using the commands hammer srpm list and hammer srpm info --id srpm_ID.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.