Install fabric on Redhat/CentOS 5

March 12, 2010    centos fabric Python redhat rpm

Fabric is a great tool for helping deploy applications. It is written in Python and still in it’s early stages. The big issue is that fabric will not run on python v2.4. That is a problem since Redhat/CentOS v5 ships with v2.4 so we have to make it work.

So the first thing to do is install python 2.5. I found great rpms here. I am going to mirror the RPMS on my blog just in case. You also need to install tkinter25 which I provide for you also. These are only for 64bit. You can do some googling to find the 32 bit versions I am sure. You also need to install libtk and libTix.

Install some dependancies

yum install tk tix

Now lets install python and tkinter

mkdir python

cd python

wget http://zcentric.com/files/python25-2.5.1-bashton1.x86_64.rpm

wget http://zcentric.com/files/python25-devel-2.5.1-bashton1.x86_64.rpm

wget http://zcentric.com/files/python25-libs-2.5.1-bashton1.x86_64.rpm

wget http://zcentric.com/files/python25-test-2.5.1-bashton1.x86_64.rpm

wget http://zcentric.com/files/python25-tools-2.5.1-bashton1.x86_64.rpm

wget http://zcentric.com/files/tkinter25-2.5.1-bashton1.x86_64.rpm

rpm -ivh *.rpm

Remove all the python25 rpms

rm -rf *.rpm

Now you have v2.4 and v2.5 installed. Now lets download the needed fabric dependancies and fabric. I built these to run for python25

wget http://zcentric.com/files/fabric-0.9-0.1.b1.noarch.rpm
wget http://zcentric.com/files/python25-setuptools-0.6c5-2.noarch.rpm
wget http://zcentric.com/files/python25-paramiko-1.7.6-1.noarch.rpm
wget http://zcentric.com/files/python25-crypto-2.0-1.rf.x86_64.rpm
rpm -ivh *.rpm
Now we just need to edit the fab file to change the python version it will run as by default
vi /usr/bin/fab
Change
#!/usr/bin/python
To
#!/usr/bin/python25
Now you can run fab and you should get something like
[root@dev1 ~]# fab
<div>
  Fatal error: Couldn&#8217;t find any fabfiles!
</div>

<div>
  Aborting.
</div>

More blog posts to come on how to use fabric



comments powered by Disqus