In this short article I will show you how to install fabric, a useful tool that can be used to automatize the way you execute ssh commands over multiple machines (from fabfile):
Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
Multiple software must be installed before you can successfully use fabric:
- Install python-devel : execute yum install python-devel
- Install epel-release: execute yum install epel-release
Alternatively you can use wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm to download the packge and then execute rpm -ivh epel-release-6-8.noarch.rpm to install it. Note that if you are located behind a proxy, you will need to set a proxy on your CentOS machine.
- Now we’ll need to install python-pip by executing yum install -y python-pip, if you receive an error saying something like: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again, then you will need to edit the epel.repo file. Execute vim /etc/yum.repos.d/epel.repo to open this configuration file in a text editor. Now comment mirrorlist section and uncomment baseurl:
- You can now execute yum update to perform a full update on the Operating System and then try again with the python-pip install. You’ll have to execute pip install paramiko==1.10 and if you receive a timeout error similar to the image below, configure a https proxy (export https_proxy=proxy.ppscu.com:3128) and then retry the install:
- To complete the install operation execute pip install fabric and wait for the download/install operation to complete: