How To Check Ansible Version on Linux

Thsi post will guide you how to check the current Ansible version on your Linux Operating system. How to get the ansible version from the command line on your CentOS or Fedora Linux system.

Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.

check ansible version linux1
Checking Ansible Version


If you have installed Ansible Tool on your Linux system, and you can type the following ansible command with –version to print the current version of Ansible. Type:

$ ansible ---version

Outputs:

[root@localhost ~]# ansible --version
ansible 2.8.5
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.7.4 (default, Jul 9 2019, 16:32:37) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]

Building the Lastest Ansible RPM


You can also build an Latest RPM of Ansible Package. you just need to checkout the latest source code from git hub site with git colone command. and then use the make rpm command to build an Ansible RPM package. type the following command:

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

Outputs:

[root@localhost ~]# git clone https://github.com/ansible/ansible.git
Cloning into 'ansible'...
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 482171 (delta 1), reused 0 (delta 0), pack-reused 482169
Receiving objects: 100% (482171/482171), 178.35 MiB | 383.00 KiB/s, done.
Resolving deltas: 100% (312833/312833), done.
Checking out files: 100% (17149/17149), done.

[root@localhost ~]# cd ./ansible/
[root@localhost ansible]#
[root@localhost ansible]# ls
bin contrib examples licenses MODULE_GUIDELINES.md requirements.txt test
changelogs COPYING hacking Makefile packaging setup.py
CODING_GUIDELINES.md docs lib MANIFEST.in README.rst shippable.yml

Installing Latest Ansible Via Apt on Ubuntu


If you are using an Ubuntu 16.04 or 18.04 system, and you can configure the PPA on your system and install the latest Ansible tool. just run the following command:

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

Installing Latest Ansible Via Apt on Debian


To install the latest Ansible Tool by using the apt command on your Debian Linux system, and you need to add the following line to /etc/apt/sources.list:

deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main

Then you need to run the following command to install Ansible, type:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
$ sudo apt update
$ sudo apt install ansible

Installing Latest Ansible Via Pkg on FreeBSD


If you are using python2 on your FreeBSD system, and you need to run the following command to installl Ansible package, type:

$ sudo pkg install py27-ansible

If you are using python3 on your system, and type the following command to install it.type:

$ sudo pkg install py36-ansible

Installing Lastest Ansible Via DNF or Yum on CentOS


If you are working on a CentOS or Fedora Linux system, and you can directly use the dnf or yum command to install Ansible, type:

$ dnf install ansible

or

$ yum install ansible

Installing Lastest Ansible Via Pacman on ArchLinux


As Ansible package is already available on the default Community repository, so you just need to run the following command to install it, type:

$ pacman -S ansible

Conclusion


You should know that how to install the latest version of Ansible Under the different Linux distribution versions.

You might also like:

Sidebar



back to top