vennedey.net

Build & install ceph-deploy RPM package on CentOS 7

On Tue, 03 Jan 2017 12:44:02 +0100 by Falco Vennedey

The last weeks I spend some time testing Openstack and setting up an Openstack cluster using Ansible for deployment and configuration management. Now I like to take a closer look into Ceph, since it can be used as a backend for Cinder, Glance and Swift. But when following the instructions for CentOS 7 as outlined in the docs and trying to install ceph-deploy from the repository I ran into some dependency problem:

[root@host ~]# yum install ceph-deploy
...
Error: Package: ceph-deploy-1.5.36-0.noarch (ceph-noarch)
           Requires: python-distribute
           Available: python-setuptools-0.9.8-4.el7.noarch (base)
               python-distribute = 0.9.8-4.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

There are other people who have had the same problem and there is also a patch available. Since the patch came without any further instructions I needed to figure out how to apply it. I used a fresh CentOS 7 Docker image to setup the build environment. Of course this will also work without Docker but if you just need a quick throwaway environment it becomes a handy tool.

root@workstation:~# docker run -it --name=ceph-deploy centos

[root@cc9153b3d205 /]# cd
[root@cc9153b3d205 ~]# yum install git python-virtualenv curl gnupg redhat-lsb-core createrepo which rpm-build rpm-sign epel-release
[root@cc9153b3d205 ~]# git clone https://github.com/ceph/ceph-deploy.git
[root@cc9153b3d205 ~]# cd ceph-deploy/
[root@cc9153b3d205 ceph-deploy]# ./bootstrap
[root@cc9153b3d205 ceph-deploy]# curl -L -O http://tracker.ceph.com/attachments/download/2389/ceph-deploy.spec.patch
[root@cc9153b3d205 ceph-deploy]# patch ceph-deploy.spec < ceph-deploy.spec.patch
[root@cc9153b3d205 ceph-deploy]# yum install python-mock python-tox pytest

The build script needs a local GnuPG key to sign the resulting rpm package. To generate a new one, run:

[root@cc9153b3d205 ceph-deploy]# gpg --gen-key

If your terminal got destroyed after key generation (specific to Docker), run reset to restore it.

Now you need to find out the ID of the freshly generated key.

[root@cc9153b3d205 ceph-deploy]# gpg --list-keys

The ID is a 8 digit hex number. If you got it, you are ready to build the package.

[root@cc9153b3d205 ceph-deploy]# export KEYID=8D42C98B; scripts/build-rpm.sh

The package can now be retrieved from /root/ceph-deploy/rpmbuild/RPMS/noarch/ceph-deploy-1.5.36-0.noarch.rpm and can be installed on the traget system using yum:

[root@host ~]# yum --nogpgcheck localinstall ceph-deploy-1.5.36-0.noarch.rpm

If you used Docker to set up your build environment, exit from the container and remove it:

[root@cc9153b3d205 ~]# exit
root@workstation:~# docker rm ceph-deploy

Comments

Write a comment
* optional