第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:
- In the Satellite web UI, navigate to Content > Products, click Create Product and enter the following details:
- In the Name field, enter a name for the product. Satellite automatically completes the Label field based on what you have entered for Name.
- Optional: From the GPG Key list, select the GPG key for the product.
- Optional: From the Sync Plan list, select a synchronization plan for the product.
- 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:
- In the Products window, select the name of a product that you want to create a repository for.
- Click the Repositories tab, and then click New Repository.
- In the Name field, enter a name for the repository. Satellite automatically completes the Label field based on the name.
- From the Type list, select file.
- In the Upstream URL field, enter the URL of the upstream repository to use as a source.
- Select the Verify SSL check box if you want to verify that the upstream repository’s SSL certificates are signed by a trusted CA.
- 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.
- In the Upstream Password field, enter the corresponding password for the upstream repository. Clear this field if the repository does not require authentication.
- Click Save.
For CLI Users
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
CommandOption Description --gpg-key
gpg_key_nameKey name to search by
--gpg-key-id
gpg_key_idGPG key numeric identifier
--sync-plan
sync_plan_nameSync plan name to search by
--sync-plan-id
sync_plan_idSync plan numeric identifier
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
CommandOption Description --checksum-type
sha_versionRepository checksum, currently 'sha1' & 'sha256' are supported
--download-policy
policy_nameDownload policy for yum repos (either 'immediate', 'on_demand', or 'background').
--gpg-key
gpg_key_nameKey name to search by
--gpg-key-id
gpg_key_idGPG key numeric identifier
--mirror-on-sync
booleanMust this repo be mirrored from the source, and stale RPMs removed, when synced? Set to
true
orfalse
,yes
orno
,1
or0
.--publish-via-http
booleanMust this also be published using HTTP? Set to
true
orfalse
,yes
orno
,1
or0
.--upstream-username
repository_usernameUpstream repository user, if required for authentication
--upstream-password
repository_passwordPassword for the upstream repository user
--url
source_repo_urlURL of the Source repository
--verify-ssl-on-sync
booleanMust Katello verify that the upstream URL’s SSL certificates are signed by a trusted CA? Set to
true
orfalse
,yes
orno
,1
or0
.