PROJECTLINUX.COM Linux Cloud Docker Devops RaspberryPi Misc News
Link 1 Link 2 Link 3

Advanced uses for Pulp

In this post I will walk through some common uses for Pulp. If you have not yet installed Pulp , Please see my post on installing Pulp. installing-pulp-on-red-hat-enterprise-linux-7

Mirror EPEL repo

These are the basic steps to follow to to sync a RPM repo. In my first post on Pulp I showed how to sync the Red Hat Enterprise 7 repo. Note that for most repos you will not need the entitlement keys that were used for Red Hat. In this example I will sync the repo at https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/. Note that if you put this link in your browser you can see the files that are going to be synced. Any repo that you can browse to can be synced using the following steps. In this example I have set the relative-url parameter to give the local repo a more friendly URL.

[root@rhelpulp ~]# pulp-admin rpm repo create --repo-id=rhel-7-epel \
--serve-http=true --retain-old-count=1  --relative-url EPEL \
--feed=https://download-ib01.fedoraproject.org/pub/epel/7/x86_64 \
[root@rhelpulp ~]# pulp-admin rpm repo sync run --repo-id=rhel-7-epel

Syncing multiple Red Hat Repos on one Pulp Server

It is possible to sync a version of Red Hat even if the pulp server is not register with Red Hat. This does require a server that is properly register with red hat for each version you want to sync. In this example I will sync the Red Hat 8 Beta Repos. Note that a new change in the Red Hat Enterprise 8 requires the baseos and appstream repos to install most package.

Copy keys from properly register server.

You will need to copy the following 3 files from a server registered with Red Hat over to the pulp server. in this example i will assume they are located in /var/pulpkeys/rhel8beta.

/etc/rhsm/ca/redhat-uep.pem
/etc/pki/entitlement/0123456789876543210.pem
/etc/pki/entitlement/0123456789876543210-key.pem

Get Repo Details

The best wat to get the details for the Red Hat repos is to use the subscription-manager command on a server registered with Red Hat. See the listings for the 2 reos we will sync.

[root@rhelpulp ~]# subscription-manager repos
Repo ID:   rhel-8-for-x86_64-baseos-beta-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/os
Enabled:   true

Repo ID:   rhel-8-for-x86_64-appstream-beta-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel8/8/x86_64/appstream/os
Enabled:   true

Create baseos repo

Create the repo for the Red Hat 8 baseos repo. Note that the –repo-id parameter can be wahtever you want, it does not need to match the output of the subscription-manager command.

[root@rhelpulp ~]# pulp-admin rpm repo create --repo-id=rhel-8-baseos --serve-http=true --retain-old-count=1  \
--feed=https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/os \
--feed-ca-cert=/var/pulpkeys/rhel8beta/redhat-uep.pem \
--feed-cert=/var/pulpkeys/rhel8beta/0123456789876543210.pem \
--feed-key=/var/pulpkeys/rhel8beta/0123456789876543210-key.pem

Create appstream repo

Create the repo for the Red Hat 8 appstream repo.

[root@rhelpulp ~]# pulp-admin rpm repo create --repo-id=rhel-8-appstream --serve-http=true --retain-old-count=1  \
--feed=https://cdn.redhat.com/content/beta/rhel8/8/x86_64/appstream/os \
--feed-ca-cert=/var/pulpkeys/rhel8beta/redhat-uep.pem \
--feed-cert=/var/pulpkeys/rhel8beta/0123456789876543210.pem \
--feed-key=/var/pulpkeys/rhel8beta/0123456789876543210-key.pem

Sync Repos

Sync the newly created repos.

[root@rhelpulp ~]# pulp-admin rpm repo sync run --repo-id=rhel-8-baseos
[root@rhelpulp ~]# pulp-admin rpm repo sync run --repo-id=rhel-8-appstream



Leave a Reply

Your email address will not be published. Required fields are marked *