Friday, November 12, 2021

[SOLVED] install Ansible on Centos 6.9

Issue

i have a machine with CentOS 6.9 as OS and it is minimal. i was trying to install Ansible on my machine. i can't connect my machine to internet to set repository and install Ansible so i downloaded ansible.tar.gz. what shoud i do to install it?
the content of tar file:

  drwxr-xr-x.  2 root root  4096 Mar 14 22:33 bin
  drwxr-xr-x.  2 root root  4096 Mar 14 22:33 changelogs
  drwxr-xr-x.  3 root root  4096 Mar 14 22:33 contrib
  -rw-r--r--.  1 root root 35148 Mar 14 22:33 COPYING
  drwxr-xr-x.  6 root root  4096 Mar 14 22:33 docs
  drwxr-xr-x.  3 root root  4096 Mar 14 22:33 examples
  drwxr-xr-x.  3 root root  4096 Mar 14 22:33 lib
  drwxr-xr-x.  2 root root  4096 Mar 14 22:33 licenses
  -rw-r--r--.  1 root root 13416 Mar 14 22:33 Makefile
  -rw-r--r--.  1 root root   759 Mar 14 22:33 MANIFEST.in
  drwxr-xr-x. 10 root root  4096 Mar 14 22:33 packaging
  -rw-r--r--.  1 root root  7298 Mar 14 22:33 PKG-INFO
  -rw-r--r--.  1 root root  4752 Mar 14 22:33 README.rst
  -rw-r--r--.  1 root root   371 Mar 14 22:33 requirements.txt
  -rw-r--r--.  1 root root 10714 Mar 14 22:33 setup.py
  -rw-r--r--.  1 root root  3624 Mar 14 22:33 shippable.yml
  -rw-r--r--.  1 root root  5565 Mar 14 22:33 SYMLINK_CACHE.json
  drwxr-xr-x. 11 root root  4096 Mar 14 22:33 test
  -rw-r--r--.  1 root root  1129 Mar 14 22:33 tox.ini

i tried to install epel then install ansible but i had no success:

 rpm -ivh epel-release-6-8.noarch.rpm

Solution

Refer to ansible docs. It explained how to install by building it yourself at the end of this part.

You can also build an RPM yourself. From the root of a checkout or tarball, use the make rpm command to build an RPM you can distribute and install.

git clone https://github.com/ansible/ansible.git
cd ./ansible
make rpm
sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm


Answered By - Mostafa Zare