第15章 Managing Custom File Type Content

In Satellite, you might require methods of managing and distributing SSH keys and source code files or larger files such as virtual machine images and ISO files. To achieve this, (customproduct)s in Red Hat Satellite include repositories for custom file types. This provides a generic method to incorporate arbitrary files in a product.

You can upload files to the repository and synchronize files from an upstream Satellite Server. When you add files to a custom file type repository, you can use the normal Satellite management functions such as adding a specific version to a Content View to provide version control and making the repository of files available on various Capsule Servers. Clients must download the files over HTTP or HTTPS using curl -O.

You can create a file type repository in Satellite Server only in a (customproduct), but there is flexibility in how you create the file type repository. You can create an independent file type repository in a directory on the system where Satellite is installed, or on a remote HTTP server, and then synchronize the contents of that directory into Satellite. This method is useful when you have multiple files to add to a Satellite repository.

15.1. Creating a Custom File Type Repository in Red Hat Satellite

The procedure for creating a custom file type repository is the same as the procedure for creating any custom content, except that when you create the repository, you select the file type. You must create a product and then add a custom repository.

Procedure

To create a (customproduct), complete the following procedure:

  1. In the Satellite web UI, navigate to Content > Products, click Create Product and enter the following details:
  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 Sync Plan list, select a synchronization plan for the product.
  5. In the Description field, enter a description of the product, and then click Save.

To create a repository for your (customproduct), complete the following procedure:

  1. In the Products window, select the name of a product that you want to create a repository for.
  2. Click the Repositories tab, and then click New Repository.
  3. In the Name field, enter a name for the repository. Satellite automatically completes the Label field based on the name.
  4. From the Type list, select file.
  5. In the Upstream URL field, enter the URL of the upstream repository to use as a source.
  6. Select the Verify SSL check box if you want to verify that the upstream repository’s SSL certificates are signed by a trusted CA.
  7. In the Upstream Username field, enter the user name for the upstream repository if required for authentication. Clear this field if the repository does not require authentication.
  8. In the Upstream Password field, enter the corresponding password for the upstream repository. Clear this field if the repository does not require authentication.
  9. Click Save.

For CLI Users

  1. Create a custom product

    # hammer product create \
    --name "My File Product" \
    --sync-plan "Example Plan" \
    --description "My files" \
    --organization "My_Organization"

    表15.1 Optional Parameters for the hammer product create Command

    OptionDescription

    --gpg-key gpg_key_name

    Key name to search by

    --gpg-key-id gpg_key_id

    GPG key numeric identifier

    --sync-plan sync_plan_name

    Sync plan name to search by

    --sync-plan-id sync_plan_id

    Sync plan numeric identifier

  2. Create a File Type Repository

    # hammer repository create \
    --name "My Files" \
    --content-type "file" \
    --product "My File Product" \
    --organization "My_Organization"

    表15.2 Optional Parameters for the hammer repository create Command

    OptionDescription

    --checksum-type sha_version

    Repository checksum, currently 'sha1' & 'sha256' are supported

    --download-policy policy_name

    Download policy for yum repos (either 'immediate', 'on_demand', or 'background').

    --gpg-key gpg_key_name

    Key name to search by

    --gpg-key-id gpg_key_id

    GPG key numeric identifier

    --mirror-on-sync boolean

    Must this repo be mirrored from the source, and stale RPMs removed, when synced? Set to true or false, yes or no, 1 or 0.

    --publish-via-http boolean

    Must this also be published using HTTP? Set to true or false, yes or no, 1 or 0.

    --upstream-username repository_username

    Upstream repository user, if required for authentication

    --upstream-password repository_password

    Password for the upstream repository user

    --url source_repo_url

    URL of the Source repository

    --verify-ssl-on-sync boolean

    Must Katello verify that the upstream URL’s SSL certificates are signed by a trusted CA? Set to true or false, yes or no, 1 or 0.