Repositories

In Pulp, a repository (or repo for short) is a collection of packages, errata, and distributions. The packages can be synchronized into Pulp from an external feed (yum, RHN, etc.) or manually uploaded and maintained by a Pulp admin. For feed-based repositories, the repo can be configured to keep itself updated from the source at scheduled intervals.

Through Pulp, clients (or consumers in Pulp terminology) are bound to a repository, enabling them to retrieve that repository's content. This binding is covered in the Consumer Bind section of the user guide.

The pulp-admin script provides ways to manipulate repositories in Pulp. The following sections describe the repository-related features that are provided.


Creation, Update, Removal, Display

Creation

The first step when working with repositories is to create one. Repository creation is done through the repo create command in the pulp-admin script. For example, to create a repository that will synchronize packages from the Pulp Fedora 14 x86_64 repository, the following command would be used:

$ pulp-admin repo create --id example --feed http://repos.fedorapeople.org/repos/pulp/pulp/fedora-14/x86_64
Successfully created repository [ example ]

The following attributes can be specified at repo creation time (all attributes are optional unless otherwise specified).

Name Flag Description
ID --id Required. Uniquely identifies the repository within the Pulp server. This ID is used when calling operations on a repo.
Name --name Display name used to better describe the content and purpose of the repo.
Architecture --arch Indicates the architecture of packages that will be found in the repo.
Feed --feed Indicates where packages should be synchronized from when populating the repo. See the section below on feeds for more information.
Feed CA Certificate --feed_ca If the feed uses an HTTPS connection, this indicates the CA certificate used to verify the server's SSL certificate. The certificate will be uploaded to the Pulp server and used when synchronizing the repository.
Feed Entitlement Certificate --feed_cert If the feed uses an HTTPS connection and requires an entitlement certificate for authentication, this indicates the certificate to use. The certificate will be uploaded to the Pulp server and used when synchronizing the repository. The file may contain both the private key as well as the certificate in which case the --feed_key should not be specified.
Feed Entitlement Private Key --feed_key When using an entitlement certificate, this indicates the certificate's associated private key.
Consumer CA Certificate --consumer_ca Full path to the CA certificate used to verify consumer certificates for protected repositories. Specifying this will flag the repository as protected. See Repository Authentication for more information.
Consumer Entitlement Certificate --consumer_cert Full path to the certificate bound consumers will receive that will grant access to this repository. The file may contain both the private key as well as the certificate in which case the --consumer_key should not be specified. See Repository Authentication for more information.
Consumer Entitlement Private Key --consumer_key Full path to file containing the certificate's associated private key. See Repository Authentication for more information.
Relative Path --relativepath Relative path at which the repository will be served. If this is not specified, the repo will default to being served at the same path as found in the feed.
Group ID --groupid Tags the repository as part of a repo group. The group does not need to be explicitly created ahead of time; simply putting a repository in a group using this attribute is the only step necessary.
GPG Keys --gpgkeys A comma-separated list of GPG public key files that can be used to verify the packages found within the repository.
Checksum Type --checksum_type checksum type to use when yum metadata is generated
Preserve Metadata --preserve_metadata Preserves the original metadata; only works with feed repos
Content Type --content_type content type allowed in this repository; default:yum; supported: [yum, file]
Packages Dir --packages_dir Directory location where the package is symlinked under the repo directory for feedless repos; for feed repos this is directly set from the source metadata

Feeds

The feed URL is just a valid url string. Supported protocols include 'http','https', 'ftp' or 'file' when creating the repository. For example:

$ pulp-admin repo create --id example --feed=https://example.com/repos
$ pulp-admin repo create --id example --feed=file:///mount/data/f14/repos

Relative Path

A repository's relative path cannot place the repository as a child of another repository. This applies both in the case where the relative path is determined from the feed URL and when it is explicitly set using the --relativepath argument. For example, serving a repository at foo/bar and another at foo/bar/baz is invalid. Serving multiple repositories in a non-repository parent is valid, for instance rhel5/i386 and rhel5/x86_64.

Update

A repository may be updated after it has been created through the repo update command in the pulp-admin script. For example, to update a repository so it will synchronize packages from the Pulp Fedora 14 i386 repository instead of the x86_84 repository, the following command would be used:

$ pulp-admin repo update --id example --feed http://repos.fedorapeople.org/repos/pulp/pulp/fedora-14/i386 --arch i386
Successfully updated repository [ example ]

The following attributes can be updated (all attributes are optional unless otherwise specified).

Name Flag Description
ID --id Required. Identifies the repository to be updated.
Name --name Change the display name which is used to better describe the content and purpose of the repo.
Architecture --arch Change the architecture of packages that will be found in the repo.
Feed --feed Change where packages should be synchronized from when populating the repo.
Feed CA Certificate --feed_ca If the feed uses an HTTPS connection, this indicates the CA certificate used to verify the server's SSL certificate. The certificate will be uploaded to the Pulp server and used when synchronizing the repository.
Feed Entitlement Certificate --feed_cert If the feed uses an HTTPS connection and requires an entitlement certificate for authentication, this indicates the certificate to use. The certificate will be uploaded to the Pulp server and used when synchronizing the repository. The file may contain both the private key as well as the certificate in which case the --feed_key is not necessary.
Feed Entitlement Private Key --feed_key When using an entitlement certificate, this indicates the certificate's associated private key.
Remove Feed Entitlement Certificate --remove_feed_cert Removes any feed HTTPS data, including the CA certificate, entitlement certificate and its private key. This cannot be specified at the same time as any of the --feed_* attributes.
Consumer CA Certificate --consumer_ca Full path to the CA certificate used to verify consumer certificates for protected repositories. Specifying this will flag the repository as protected. See Repository Authentication for more information.
Consumer Entitlement Certificate --consumer_cert Full path to the certificate bound consumers will receive that will grant access to this repository. The file may contain both the private key as well as the certificate in which case the --consumer_key should not be specified. See Repository Authentication for more information.
Consumer Entitlement Private Key --consumer_key Full path to file containing the certificate's associated private key. See Repository Authentication for more information.
Remove Consumer Entitlement Certificate --remove_consumer_cert Disabled repository authentication from the repository. For more information, see Repository Authentication.
Relative Path --relativepath Change the relative path at which the repository will be served. If this is not specified, the repo will default to being served at the same path as found in the feed.
Group ID --groupid Tags the repository as part of a repo group. The group does not need to be explicitly created ahead of time; simply putting a repository in a group using this attribute is the only step necessary.
Add GPG keys --addkeys A comma-separated list of GPG public key files to be added.
Remove GPG keys --rmkeys A comma-separated list of GPG public key files to be removed.
Checksum Type --checksum_type checksum type to use when yum metadata is generated
Packages Dir --packages_dir Directory location where the package is symlinked under the repo directory for feedless repos; for feed repos this is directly set from the source metadata

Removal

Removing a repository from Pulp is as simple as running the repo delete command.

$ pulp-admin repo delete --id example

Display

There are a number of different views into a repository's contents.

Repository List

The list of all repositories in the Pulp server can be retrieved with the repo list command.

$ pulp-admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id              	example                  
Name               	example                  
FeedURL            	http://example.com/repos 
FeedType           	yum                      
Arch               	noarch                   
Sync Schedule      	None                     
Packages           	0                        
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None

The following fields are displayed for each repository:

Name Description
ID Unique identifier for the repository; used throughout the Pulp interfaces when referring to the repo.
Name User-friendly, descriptive name of the repository.
Repo URL URL of where the repository is hosted on the Pulp server
Feed URL URL of the feed from which this the contents of this repository will be synchronized.
Feed Type Identifies the synchronization scheme used when downloading content from the feed.
Content Type Identifies the content type of the repository, yum or file.
Feed Certs Indicates whether certificates are used for the repository feed.
Consumer Certs Indicates whether certificates are used for consumer access.
Architecture Describes the architecture of packages found within the repository.
Synchronization Schedule Cron syntax describing when (if at all) the repository will automatically be synchronized.
Packages Number of packages in the repository.
Files Number of non-package files in the repository.
Distributions Displays the name of all distributions that are present in the repository.
Publish Indicates if the repository is being served by Pulp. If this is "False", the repository content exists in the Pulp server but is not accessible to consumers.
Clones List of repository IDs of repos cloned from the repo being displayed.
Groups A list of groups to which the repository belongs.
Filters A list of filters that are associated with this repository.
Notes A dictionary of additional key-value information about repository.
Preserve Metadata Indicates whether metadata is regenerated during repository synchronization.
Checksum Type Identifies the checksum type in the yum metadata for the repository.

You can also query repositories based on certain supported filtering parameters like group id, notes.

$ sudo pulp-admin repo list --note test-key:test-value
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                  test-repo2               
Name                test-repo2               
Feed URL            None                     
Feed Type           None                     
Content Type        yum                      
Feed Certs          CA:No   Cert:No
Consumer Certs      CA:No   Cert:No
Architecture        noarch                   
Sync Schedule       None                     
Packages            0                        
Files               0                        
Distributions       None                     
Publish             True                     
Clones              []                       
Groups              ['test-grp']             
Filters             []                       
Notes               {'test-key': 'test-value'}


Id                  test-repo1               
Name                test-repo1               
Feed URL            None                     
Feed Type           None                     
Content Type        yum                      
Feed Certs          CA:No   Cert:No
Consumer Certs      CA:No   Cert:No
Architecture        noarch                   
Sync Schedule       None                     
Packages            0                        
Files               0                        
Distributions       None                     
Publish             True                     
Clones              []                       
Groups              None                     
Filters             []                       
Notes               {'test-key': 'test-value'}

You can also combine multiple query parametes:

$ sudo pulp-admin repo list --note test-key:test-value --groupid=test-grp
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                  test-repo2               
Name                test-repo2               
Feed URL            None                     
Feed Type           None                     
Content Type        yum                      
Feed Certs          CA:No   Cert:No
Consumer Certs      CA:No   Cert:No
Architecture        noarch                   
Sync Schedule       None                     
Packages            0                        
Files               0                        
Distributions       None                     
Publish             True                     
Clones              []                       
Groups              ['test-grp']             
Filters             []                       
Notes               {'test-key': 'test-value'}

Status

Synchronization status information can be found for an individual repository through the repo status command. Since this command is only retrieving information on a specific repository, the --id flag is required.

$ pulp-admin repo status --id example
+------------------------------------------+
             Status for example
+------------------------------------------+
Repository: example
Number of Packages: 0
Last Sync: never

Contents

The list of items in a repository can be displayed with the repo content command. Again, the --id flag is required to indicate the repository being queried.

$ pulp-admin repo content --id pulp-f14-64
+------------------------------------------+
           Contents of pulp-f14-64
+------------------------------------------+

Packages in pulp-f14-64: 

python-pymongo-1.6-5.fc14.x86_64.rpm
pulp-client-0.0.117-1.fc14.noarch.rpm
grinder-0.0.67-1.fc14.noarch.rpm
gofer-lib-0.10-1.fc14.noarch.rpm
pulp-common-0.0.117-1.fc14.noarch.rpm
pulp-cds-0.0.117-1.fc14.noarch.rpm
pulp-0.0.117-1.fc14.noarch.rpm
python-webpy-0.32-6.fc14.noarch.rpm
gofer-0.10-1.fc14.noarch.rpm
python-qpid-0.7.946106-1.fc14.noarch.rpm

Errata in pulp-f14-64: 

 none

Files in pulp-f14-64: 

 none

List GPG Keys

The list of GPG keys associated with the repository can be obtained using the repo list_keys command. Again, the --id flag is required to indicate the repository being queried.

$ pulp-admin repo list_keys --id pulp-f14-64
+------------------------------------------+
   GPG keys associated with pulp-f14-64
+------------------------------------------+

RPM-GPG-KEY-fedora

Synchronization

If a repository is configured with a feed, content can be downloaded from that feed into the Pulp server. This synchronization can occur either through a manual command in the pulp-admin script or configured to automatically run at a set time (for more information on scheduling repo synchronization, see the repo creation section of this guide).

The simplest syntax for synchronizing a repository is as follows:

$ pulp-admin repo sync --id pulp-f14-64

By default, the sync runs asynchronously. In other words, the repo sync command will immediately return, however the actual download will proceed on the server. The status of the sync can be found with the repo status command:

$ pulp-admin repo status --id pulp-f14-64
+------------------------------------------+
           Status for pulp-f14-64
+------------------------------------------+
Repository: pulp-f14-64
Number of Packages: 10
Last Sync: 2011-01-07 15:36:45.161000
Currently syncing: 50% done (5 of 10 packages downloaded)

Alternatively, the sync can be run in the foreground by passing the -F flag to the sync call:

$ pulp-admin repo sync --id pulp-f14-64 -F
Sync for repository pulp-f14-64 started
Step: Downloading Items or Verifying
[===                      ] 14%
Rpms: 4/15
Total: 4/15 items

In addition to the -F flag, the following options are available to the repo sync call. These are only available when running a manual sync using pulp-admin repo sync and are not supported for scheduled sync jobs.

Name Flag Description
Show Schedule --show-schedule If specified, show the sync schedule and exit
Delete Schedule --delete-schedule If specified, remove the sync schedule and exit
Set Schedule Interval --interval If specified, schedule the sync, repeating on the given interval
Set Number of Runs --runs When used with --interval, limit the number of time the sync is repeated to the given number of runs
Set Start Time --start When used with --interval, delay the first scheduled sync until the given start time. The format follows the Time Units guidelines. If omitted, the sync starts immediately.
Exclude Elements --exclude (cumulative) Exclude the element(s) specified from the sync. Valid elements are: packages, errata, and/or distribution. Note if packages is specified, but errata is not, the packages for the errata will still be synchronized.
Timeout --timeout Time for the sync to run before being timed out. The format follows the Time Units guidelines.
Limit Bandwidth Per Thread --limit If specified, will limit the bandwidth each thread uses when synchronizing yum content. Value is expected to be in KB/sec.
Threads --threads If specified, will allow this many threads to be used for synchronization.
Sync in the Foreground -F or --foreground Report the sync progress on the command line. Conflicts with --start

A running sync for a repository can be cancelled using a repo cancel_sync command.

$ pulp-admin repo cancel_sync --id test-repo
Sync for repository test-repo is being canceled

If you were running sync in foreground at this time, you will see a Canceled message.

$ pulp-admin repo sync --id test-repo -F
Sync for repository test-repo started
Sync: Canceled

Item Details: 
RPMs: 0/21

Packages

Add Package

Packages can be associated with a repository using the pulp-admin script. When add_package is invoked, a package is selected from a source repository and added to the destination repository. During this process, a dependency lookup happens for the requested package(s) and the call provides a suggestive option to choose to any dependencies required by this call.

The repo add_package command takes following arguments:

Name Flag Description
ID --id Target repository Id to add the package.
Package Name -p or --package Package filename to add to this repository.
Source ID --source Source repository with specified packages to perform add.
Assume Yes -y or --assumeyes Assume yes; automatically process dependencies as part of add operation.
Recursive -r or --recursive Recursively lookup the dependency list; defaults to one level of lookup.

Example: Add a package from source to target repository (top level dependency resolution)

$ pulp-admin repo add_package --id=test17 --source=f13-updates -p lxc-libs-0.7.2-1.fc13.x86_64 

Example: Add a package from source to target repository (recursive)

$ pulp-admin repo add_package --id=test17 --source=f13-updates -p lxc-libs-0.7.2-1.fc13.x86_64 -r

Remove Package

The repo remove_package command is used to indicate a package to remove from a Pulp repository. During this process, a dependency lookup happens for the requested package and the call provides a suggestive option to choose to any dependencies required by this call.

The repo remove_package command takes following arguments:

Name Flag Description
ID --id Target repository Id to delete the package.
Package Name -p or --package Package filename to delete from this repository.
Assume Yes -y or --assumeyes Assume yes; automatically process dependencies as part of delete operation.
Recursive -r or --recursive Recursively lookup the dependency list; defaults to one level of lookup.

Example: Remove a package from repository (top level dependency resolution)

 $ pulp-admin repo remove_package --id=test17 -p lxc-libs-0.7.2-1.fc13.x86_64

Example: Remove a package from repository (recursive)

 $ pulp-admin repo remove_package --id=test17 -p lxc-libs-0.7.2-1.fc13.x86_64 -r

Files

Add File

Files can be associated with a repository using the pulp-admin script. When add_file is invoked, a file is selected from a source repository (if specified) or from the Pulp server in general and added to the destination repository. Files can be specified with multiple -f or via --csv. Both options cannot be used in the same command.

The repo add_file command takes following arguments:

Name Flag Description
ID --id Identifies the target repository to add files to.
Files -f or --filename File to add to this repository.
Source ID --source Source repository with specified file to perform add (optional).
CSV File --csv A csv file to perform batch operations on. Format: filename,checksum

Example: Add file from source to target repository

$ pulp-admin repo add_file --id testrepo --source myfiles -f test.iso

Example: Add an orphaned file to target repository

$ pulp-admin repo add_file --id testrepo -f test.iso

Example: Add a batch of files to target repository

$ pulp-admin repo add_file --id testrepo --csv test.csv

Delete File

The repo remove_file command is used to remove files from a repository. Files can be specified with multiple -f or via --csv. Both options cannot be used in the same command. It takes the following arguments:

Name Flag Description
ID --id Identifies the target repository to remove files from.
Files -f or --filename File to remove from this repository.
CSV File --csv A CSV file to perform batch operations on. Format: filename,checksum

Example: remove file from target repository

$ pulp-admin repo remove_file --id testrepo -f test.iso

Example: remove a batch of files to target repository

$ pulp-admin repo remove_file --id testrepo --csv test.csv

Cloning

Repository cloning is a simple way to create a new repository seeded with content from an existing Pulp repository.

For example, given a spacewalk repository on Pulp server, a clone of this repository can be created as follows:

$ pulp-admin repo clone --id spacewalk --clone_id spacewalk-clone

This command will have the same effect as -

$ pulp-admin repo clone --id spacewalk --clone_id spacewalk-clone --feed parent

In this case, the feed of the cloned repo will point to contents of parent repository on the pulp server. You can specify type of feed to be used for the cloned repository using --feed option. If --feed option is not specified, feed will default to parent as shown in the example above.

There are two more types of repository clones:

Clone with Origin Feed

In this case, the feed of the cloned repository will be the same as that of parent repository.

 $ pulp-admin repo clone --id spacewalk --clone_id spacewalk-clone-origin --feed origin -F

Clone without Parent or Origin Feed

This is also known as a feedless clone. In this case, the feed of the the cloned repository is 'None'.

$ pulp-admin repo clone --id spacewalk --clone_id spacewalk-clone-feedless --feed none -F

Note that in all of the above cases, immediately after the cloning operation is finished, both parent and clone have same content (packages, errata, distributions). In case of the default cloning with parent feed and cloning with origin feed, a sync operation can performed at any time on cloned repo using the repo sync command. In feedless clone, a sync cannot be performed but packages can be uploaded manually (see the Packages - Upload section for more information).

Depending upon the content of the origin repository, the cloning operation can take a long time. Similar to repo sync, the clone operation runs asynchronously by default.

$ pulp-admin repo clone --id example --clone_id clone_example
Repository [example] is being cloned as [clone_example]
Use "repo status" to check on the progress

The status of the clone can be viewed with the repo status command specifying the ID of the cloned repo. Alternatively, the clone operation can be run in the foreground by passing the -F flag.

$ pulp-admin repo clone --id example --clone_id clone_example -F
Repository [example] is being cloned as [clone_example]
You can safely CTRL+C this current command and it will continue
[==================================================] 100% (10 of 10 pkgs)
Clone: Finished

A running clone of a repository can be cancelled using a repo cancel_clone command.

$ pulp-admin repo cancel_clone --id test-clone
Clone for this repository test-clone is being canceled

If you were running clone in foreground at this time, you will see a Canceled message.

$ pulp-admin repo clone --id test-repo --clone_id test-clone -F
Repository [test-repo] is being cloned as [test-clone]
Clone: Canceled

Item Details: 
RPMs: 0/21

Filters

Repository filters are ways of filtering the available content for repositories with local feed.

Filters are of 2 types -

A filter can be associated with multiple repositories and a repository can have multiple filters. If a repository has whitelist as well as blacklist filters associated with it, all the source packages matching whitelist filters are synced except for ones matching blacklist filters.

Creation and Update

Filters can be created using filter create command in the pulp-admin script. For example, to create a filter that filter out all openoffice.org packages and broadcom-wl-5.100.82.38-1.fc13.noarch package, the following command would be used:

$ pulp-admin filter create --id=test-filter --type=blacklist --description="Openoffice and broad-wl filter" -p "openoffice.org*" -p "broadcom-wl-5.100.82.38-1.fc13.noarch" 
Successfully created filter [ test-filter ]

Id and type are the required attributes, however, you do not have to provide packages at the time of creation. You can do so later by using "filter add_packages" and "filter remove_packages" commands. You can provide multiple packages as shown using multiple -p options. You can provide a package name, full NVRA or a regex as an argument to -p option.

$ pulp-admin filter create --id=pulp-whitelist-filter --type=whitelist
Successfully created filter [ pulp-whitelist-filter ]

$ pulp-admin filter add_packages --id=pulp-whitelist-filter -p "pulp*" -p "grinder"
Successfully added packages to filter [ pulp-whitelist-filter ]

$ pulp-admin filter remove_packages --id=pulp-whitelist-filter -p "grinder"
Successfully removed packages to filter [ pulp-whitelist-filter ]

List and Info

All repo filters can be listed using "filter list" and individual filter information is available through "filter info".

$ sudo pulp-admin filter list
+------------------------------------------+
              Available Filters
+------------------------------------------+

Id           :               	test-filter              
Description  :               	Openoffice and broad-wl filter
Type         :               	blacklist                
Package List :               	[u'openoffice.org*', u'broadcom-wl-5.100.82.38-1.fc13.noarch']


Id           :               	pulp-whitelist-filter    
Description  :               	pulp-whitelist-filter    
Type         :               	whitelist                
Package List :               	[u'pulp*']               
$ sudo pulp-admin filter info --id=test-filter

Id           :               	test-filter              
Description  :               	Openoffice and broad-wl filter
Type         :               	blacklist                
Package List :               	[u'openoffice.org*', u'broadcom-wl-5.100.82.38-1.fc13.noarch']

Delete

A filter can be deleted using "filter delete". If a filter is associated with any repositories, all associations are deleted along with filter.

$ pulp-admin filter delete --id=test-filter
Successfully deleted Filter [ test-filter ]

Association with Repositories

There are two ways in which you can associate filters with repositories:

$ pulp-admin repo clone --id=test-repo --clone_id=clone-test-repo -f filter1 -f filter2

Multiple filters can be specified using multiple -f options. You can verify packages synced using "repo content" to make sure filters were applied successfully. Note that this will not work with repo clone with "origin" feed as filters work only with repositories with "local" feed.

Successive syncs with continue to apply filters associated with repository unless you remove them using "repo remove_filters" command as shown-

$ pulp-admin repo remove_filters --id=clone-test-repo -f filter1
Successfully removed filters ['filter1'] from repository [clone-test-repo]
$ pulp-admin repo add_filters --id=clone-test-repo -f filter1 -f filter2
Successfully added filters ['filter1','filter2'] to repository [clone-test-repo]

Publish

The ability to control if a repository is accessible from HTTPS requests may be set through the repo publish command.


Discovery

Perform repo discovery for a specified url and type. This command will wait for the discovery to complete and prompt the user to select which repositories to import.

The repo discovery command takes following arguments:

Name Flag Description
URL -u or --url Base URL to perform discovery (required). Supports http, https and file based urls(path should be accessible by apache)
TYPE -t or --type Content type to look for during discovery (required); supported types: 'yum'
ASSUMEYES -y or --assumeyes Assume yes; automatically create Pulp repositories for discovered repositories (optional).
GROUPID -g or --groupid Group IDs (one or more) to associate the discovered repos (optional).
CA Certificate --ca If the feed uses an HTTPS connection, this indicates the CA certificate used to verify the server's SSL certificate. The certificate will be uploaded to the Pulp server and used when synchronizing the repository.
Entitlement Certificate --cert If the feed uses an HTTPS connection and requires an entitlement certificate for authentication, this indicates the certificate and key combined to use. The certificate pem will be uploaded to the Pulp server and used when synchronizing the repository.

Example: perform a repo discovery interactively

$ sudo pulp-admin repo discovery -u http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/ -t yum
Discovering urls with yum metadata, This could take some time...
Waiting -
+------------------------------------------+
 Repository Urls discovered @ [http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/]
+------------------------------------------+
(-)  [1] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo_smaller/
(-)  [2] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo/

Select urls for which candidate repos should be created (h for help):h
  'a'   	 : select all
  'x:y' 	 : select a range eg:1:3
  <sel> 	 : select value between 1 and 2
  'y'   	 : confirm selection
  'c'   	 : clear selections
  'q'   	 : abort the repo creation
Select urls for which candidate repos should be created (h for help):1:2
(+)  [1] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo_smaller/
(+)  [2] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo/

Select urls for which candidate repos should be created (h for help):y

Creating candidate repos for selected urls..
Successfully created repo [repos-pulp-pulp-demo_repos-test_bandwidth_repo_smaller]
Successfully created repo [repos-pulp-pulp-demo_repos-test_bandwidth_repo]

Example: perform repo discovery non-interactively

$ sudo pulp-admin repo discovery -u http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/ -t yum -y
Discovering urls with yum metadata, This could take some time...
Waiting \
+------------------------------------------+
 Repository Urls discovered @ [http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/]
+------------------------------------------+
(+)  [1] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo_smaller/
(+)  [2] http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos//test_bandwidth_repo/

Creating candidate repos for selected urls..
Successfully created repo [repos-pulp-pulp-demo_repos-test_bandwidth_repo_smaller]
Successfully created repo [repos-pulp-pulp-demo_repos-test_bandwidth_repo]

Example: perform repo discovery on authenticated repos

sudo pulp-admin repo discovery --url=https://<hostname>/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/ --ca=/certs/ca.crt --cert=/certs/cert.pem --type=yum
Discovering urls with yum metadata, This could take some time...
Number of Urls Discovered: 4
+------------------------------------------+
 Repository Urls discovered @ [https://<hostname>/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/]
+------------------------------------------+
(-)  [1] https://<hostname>/dist/rhel/rhui/server-6/releases/6Server/x86_64/source/SRPMS
(-)  [2] https://<hostname>/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/scalablefilesystem/os
(-)  [3] https://<hostname>/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/resilientstorage/os
(-)  [4] https://<hostname>/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/os/Server

Select urls for which candidate repos should be created (h for help):

Generate Metadata

Schedules metadata generation for a specific repository. This creates an asynchronous task and queues it. The status for this task can be checked with a status flag.

The repo generate_metadata command takes following arguments:

Name Flag Description
ID --id Identifies the repository to generate metadata.
Status --status Metadata generation status for this repository.

Example: schedule a metadata generation for a repository

$ pulp-admin repo generate_metadata --id testrepo

Example: check the metadata schedule status for a repository

$ pulp-admin repo generate_metadata --id testrepo --status

Add Metadata

Add custom filetypes for a specific repository metadata. This integrates the custom data to existing metadata.

The repo add_metadata command takes following arguments:

Name Flag Description
ID --id Identifies the repository to add metadata.
MDTYPE --mdtype metadata type to add to the repository metadata
PATH --path path to the metadata file to be added

Example: Add a custom file type to repository metadata

  $ pulp-admin repo add_metadata --id=test_metadata --mdtype=product --path=/data/product.gz 

List Metadata

List all filetypes information in specific repository metadata.

The repo list_metadata command takes following arguments:

Name Flag Description
ID --id Identifies the repository to list metadata.

Example: List repository metadata

  $ pulp-admin repo list_metadata --id=test_metadata

Download Metadata

Download a specific filetype from existing repository metadata.

The repo download_metadata command takes following arguments:

Name Flag Description
ID --id Identifies the repository from which to download metadata.
MDTYPE --mdtype metadata type to download from repository
OUT --out output file to store the exported metadata file (optional); default is stdout

Example: Download repository metadata

  $ sudo pulp-admin repo download_metadata --id=test_metadata --mdtype=product --out=product.gz

Remove Metadata

Remove a specific filetype from existing repository metadata.

The repo remove_metadata command takes following arguments:

Name Flag Description
ID --id Identifies the repository from which to remove metadata.
MDTYPE --mdtype metadata type to remove from repository

Example: Remove 'product' metadata type from a repository

  $ sudo pulp-admin repo remove_metadata --id=test_metadata --mdtype=product

Group Operations

update

All repositories belonging to a group may be updated through the "repogroup update" command in the pulp-admin script. For example, to update all repositories belonging to test-group, following commands can be used:

$ sudo pulp-admin repogroup update --id=test-group --feed_cert=/tmp/test-cert --feed_key=/tmp/test-key 
Successfully updated repositories belonging to group[ test-group ]

$ sudo pulp-admin repogroup update --id=test-group --addkeys=/tmp/RPM-GPG-KEY-test 
uploading /tmp/RPM-GPG-KEY-test
Successfully updated repositories belonging to group[ test-group ]

$ sudo pulp-admin repogroup update --id=test-group --interval=P1DT1H5M 
Successfully updated repositories belonging to group[ test-group ] except for the following repositories: 

[ repo3 ]
PulpException: 'Cannot add schedule to repository with out sync source'

The following attributes can be updated (all attributes are optional unless otherwise specified).

Name Flag Description
ID --id Required. Identifies the repository group to be updated.
Architecture --arch Change the architecture of packages that will be found in repos belonging to the group.
Schedule Interval --interval Time between scheduled syncs in iso8601 format
Schedule Start --start Date and time of first scheduled sync in iso8601 format (optional: not specified means to run immediately)
Schedule Runs --runs Total scheduled syncs (optional: not specified means run indefinitely)
Delete Schedule --delete-schedule Delete an existing schedule for all repos belonging to the group
Feed CA Certificate --feed_ca If the feed uses an HTTPS connection, this indicates the CA certificate used to verify the server's SSL certificate. The certificate will be uploaded to the Pulp server and used when synchronizing all repositories in this group.
Feed Entitlement Certificate --feed_cert If the feed uses an HTTPS connection and requires an entitlement certificate for authentication, this indicates the certificate to use. The certificate will be uploaded to the Pulp server and used when synchronizing repositories in this group. The file may contain both the private key as well as the certificate in which case the --feed_key is not necessary.
Feed Entitlement Private Key --feed_key When using an entitlement certificate, this indicates the certificate's associated private key.
Remove Feed Entitlement Certificate --remove_feed_cert Removes any feed HTTPS data, including the CA certificate, entitlement certificate and its private key. This cannot be specified at the same time as any of the --feed_* attributes.
Consumer CA Certificate --consumer_ca See Repository Authentication
Consumer Entitlement Certificate --consumer_cert See Repository Authentication
Consumer Entitlement Private Key --consumer_key See Repository Authentication
Remove Consumer Entitlement Certificate --remove_consumer_cert Disable repository authentication from all repositories in this group. For more information, see Repository Authentication.
Add GPG keys --addkeys A comma-separated list of GPG public key files to be added.
Remove GPG keys --rmkeys A comma-separated list of GPG public key files to be removed.

Export

Exports repository content to a target location. Optionally the exported content can be wrapped into iso images.

The repo export command takes following arguments:

Name Flag Description
ID --id repository Id to export.
Target Directory -t or --target_dir target location on server to write the exported content
Generate ISO --generate-isos wrap exported content into iso images (optional).
Overwrite --overwrite overwrite existing content in target location (optional).

Example: Export a repository to a target location on server

 $ pulp-admin repo export --id=<repoid> --target_dir /data/myrepo/

Example: Export a repository and generate isos

 $ pulp-admin repo export --id=<repoid> --target_dir /data/myrepo/ --generate-iso

Example: Export a repository and generate isos to an existing target directory

 $ pulp-admin repo export --id=<repoid> --target_dir /data/myrepo/ --generate-iso --overwrite

Distributions

Add Distribution

Distributions can be associated with a repository using the pulp-admin script. When add_distribution is invoked, a distribution is selected from a source repository (if specified) or from the Pulp server in general and added to the destination repository. The distribution tree is symlinked to the repo location when add operation is performed. The repo add_distribution command takes following arguments:

Name Flag Description
ID --id Identifies the target repository to add distributions.
DistributionID -d or --distributionid distribution to associate to this repository.
Source ID --source Source repository with specified distribution to perform add (optional).

Example: Add distribution from source to target repository

$ pulp-admin repo add_distribution --id testrepo --source mydistrepo -d ks-fedora-14-i386

Example: Add a distribution to target repository

$ pulp-admin repo add_distribution --id testrepo -d ks-fedora-14-i386

Remove Distribution

The repo remove_distribution command is used to remove distributions from a repository. The distribution tree files are unlinked from repo location. The distribution is not removed from pulp server if it has any references. It takes the following arguments:

Name Flag Description
ID --id Identifies the target repository to remove distributions.
DistributionID -d or --distributionid distribution to remove from this repository.

Example: remove distribution from target repository

$ pulp-admin repo remove_distribution --id testrepo -d ks-fedora-14-i386

Repository Notes

Pulp provides the ability to create custom attributes for repositories using notes. These are similar to key-value attributes for consumers.

Creation, Deletion, Update

For example, take a scenario where multiple repositories in Pulp server need to be grouped together as blacklisted repositories. You can add blacklisted: True to notes of these repositories.

$ pulp-admin repo add_note  --id test1 --key key1 --value value1
Successfully added key-value pair key1:value1

Attributes can be updated or deleted as follows:

$ pulp-admin repo update_note --id test1 --key key1 --value value2
Successfully updated key-value pair key1:value2

$ pulp-admin repo delete_note --id test1  --key key1
Successfully deleted key: key1

List

Repository listing will show notes added to each repository:

$ pulp-admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                 	test1                    
Name               	test1                    
Repo URL           	https://sunflower/pulp/repos/test1/
Feed URL           	None                     
Feed Type          	None                     
Content Type       	yum                      
Feed Certs         	CA:No   Cert:No
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	0                        
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None                     
Filters            	[]                       
Notes              	{'key1': 'value1'}       
Preserve Metadata  	False               


Id                 	test2                    
Name               	test2                    
Repo URL           	https://sunflower/pulp/repos/test2/
Feed URL           	None                     
Feed Type          	None                     
Content Type       	yum                      
Feed Certs         	CA:No   Cert:No
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	0                        
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None                     
Filters            	[]                       
Notes              	{'key2': 'value2'}       
Preserve Metadata  	False           

In addition, you can also filter repositories based on a note:

$ sudo pulp-admin repo list --note key1:value1
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                 	test1                    
Name               	test1                    
Repo URL           	https://sunflower/pulp/repos/test1/
Feed URL           	None                     
Feed Type          	None                     
Content Type       	yum                      
Feed Certs         	CA:No   Cert:No
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	0                        
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None                     
Filters            	[]                       
Notes              	{'key1': 'value1'}       
Preserve Metadata  	False