Quick Start

Below are a few examples of how to use Pulp to get content synchronized locally to your server and make it available to systems. The examples assume you have installed and configured Pulp according to the Installation Guide.

Basic Usage

The starting point for a new Pulp installation is the pulp-admin command. Help information is available for both the pulp-admin and pulp-consumer scripts:

$ pulp-admin --help
Usage: pulp-admin <options> <command>
Supported Commands:
	auth           stores pulp authentication credentials
	consumer       consumer specific actions to pulp server
	consumergroup  consumer group specific actions to pulp server
	distribution   distribution specific actions to pulp server
	errata         errata specific actions to pulp server
	package        package specific actions to pulp server
	packagegroup   package group specific actions to pulp server
	repo           repository specific actions to pulp server
	user           user specific actions to pulp server

  -h, --help            show this help message and exit

  Pulp User Account Credentials:
    -u USERNAME, --username=USERNAME
                        account username
    -p PASSWORD, --password=PASSWORD
                        account password
    -s SERVER, --server=SERVER
                        pulp server host

Each command has its own associated help documentation:

$ pulp-admin repo --help
Usage: pulp-admin <options> repo <action> <options>
Supported Actions:
	list           list available repositories
	status         show the status of a repository
	content        list the contents of a repository
	create         create a repository      
	clone          clone a repository       
	delete         delete a repository      
	update         update a repository      
	sync           synchronize data to a repository from its feed
	cancel_sync    cancel a running sync    
	upload         upload package(s) to a repository
	schedules      list all repository schedules
	listkeys       list gpg keys            
	publish        enable/disable repository being published by apache

  -h, --help  show this help message and exit

Authenticate with Pulp Server

Pulp ships with a default 'admin' account defined in /etc/pulp/pulp.conf

default_login: admin
# Highly recommend you change this with "pulp-admin user update" 
default_password: admin

The first thing that should be done is to change the admin password using the user update command:

$ pulp-admin -u admin -p admin user update --username admin --password <new password> --name "Some Admin"
Successfully updated [ admin ] with name [ Some Admin ]

Instead of passing the user credentials on each call to the pulp-admin script, the credentials can be stored in your home directory by issuing the auth login command:

$ pulp-admin auth login -u admin -p *****
User credentials successfully stored at [/home/someadmin/.pulp]

Subsequent calls can omit the user credentials:

$ pulp-admin repo list
No repositories available to list

Synchronize Fedora 14

Now that we are setup to issue commands to the Pulp server, lets see if we can get some content synchronized.

The first step is to pick a repository to synchronize:

  1. Go to the mirrors list: http://mirrors.fedoraproject.org/publiclist/
  1. Choose a mirror near you and find the URL to the root of the architecture you wish to synchronize (e.g. http://mirror.uoregon.edu/fedora/linux/releases/14/Fedora/x86_64/os/)
  1. Create a repo in the Pulp server using the pulp-admin script. Note the --feed parameter denotes the type of repository to be synchronized. The type helps Pulp figure out what synchronization strategy to use when copying the content.
    $ pulp-admin repo create --id f14-x86_64 --feed http://mirror.uoregon.edu/fedora/linux/releases/14/Fedora/x86_64/os/
    Successfully created repository [ f14-x86_64 ]
  1. Now we can sync the newly created repository. You can watch this progress or CTRL+C and come back later to see its progress.
    $ pulp-admin repo sync --id f14-x86_64 -F
    Sync for repository f14-x86_64 started
    You can safely CTRL+C this current command and it will continue
    [                                                     ] 0%

Register a Consumer (System) to Pulp

After content is synchronized to Pulp, the next step is to connect a system so it can start installing packages from your Pulp repository. The pulp-consumer is used for registration with a Pulp server. See the Consumer Client Guide for installation and configuration information.

  1. Using the pulp-consumer script, register the client system with the Pulp server:
    $ sudo pulp-consumer -u admin -p ****** consumer register --id myclient
    Successfully created consumer [ myclient ]
  1. Once the consumer is registered, we can see a list of possible repositories to use:
    $ sudo pulp-consumer repo list
           List of Available Repositories
    Label              	f14-x86_64               
    Name               	f14-x86_64               
    FeedURL            	http://mirror.uoregon.edu/fedora/linux/releases/14/Fedora/x86_64/os/
    FeedType           	yum                      
    Arch               	noarch                   
    Sync Schedule      	None                     
    Packages           	0                        
    Files              	0                        
    Distributions      	None                     
    Publish            	True                     
    Clones             	[]                       
  1. To use a repository, it is bound to the client system. Binding a repository makes that repository available to the client system:
    $ sudo pulp-consumer consumer bind --repoid f14-x86_64
    Successfully subscribed consumer [myclient] to repo [f14-x86_64]
  1. The pulp-consumer script creates a repo config file at /etc/yum.repos.d/pulp.repo for the newly bound repository:
    $ cat /etc/yum.repos.d/pulp.repo 
    # Pulp Repositories
    # Managed by Pulp client
    name = f14-x86_64
    baseurl = https://localhost/pulp/repos/fedora/linux/releases/14/Fedora/x86_64/os
    enabled = 1
    sslverify = 0
  1. At that point, the repository is available for use with yum:
    $ sudo yum --disablerepo=* --enablerepo=f14-x86_64 install zsh
      Installing     : zsh-4.3.10-5.fc13.x86_64
      zsh.x86_64 0:4.3.10-5.fc13