How Do You Install Ansible on a Debian Linux Server Running in GCP?

Problem scenario
You are using Google Cloud Platform, and you have a Debian server.  You do not want to configure any PPAs for your system.*  How do you install and configure Ansible on a Debian Linux system?

Solution
Prerequisite

We strongly recommend having 2.5 GB of memory (either in RAM or with a combination of RAM and swap space).   For directions on how to configure swap space in the amount of 2 GB, see this posting.  You can get Ansible installed with 0.6 GB of memory.  But we do not think the performance would be acceptable with this configuration.

Procedures
1.a.  Create a script called ansible.sh in /tmp.

1.b.  Have this as the content:

apt-get -y update
apt-get -y install git python-setuptools gcc python-dev libffi-dev python-openssl make
cd /opt
git clone git://github.com/ansible/ansible.git --recursive
cd ansible
python setup.py build
python setup.py install  

2.  Run this script like this:  sudo bash /tmp/ansible.sh

3.  Test it was successful:  ansible --version

*  If you want to try to configure a PPA on Ubuntu Linux, see this external article (https://www.cyberciti.biz/faq/how-to-install-and-configure-latest-version-of-ansible-on-ubuntu-linux/).  If you want to try to configure a PPA on a Debian Linux system, you can use this external link at your own risk.

Leave a comment

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