How to check Ansible version on Linux/Unix

last updated in Categories ,

How do I check Ansible version (IT automation tool) on my Linux or Unix-like server using the command prompt?

Ansible is a free and open-source automation software that automates software provisioning, configuration management, and application deployment. It is written in Python. It works with SSH and no agent needed on the remote server. This page shows how to check Ansbile version using the command line option.

Linux check ansible version command

Open the terminal Application and type the following command:
$ ansible --version
Sample outputs:

  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/vivek/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

I am using Ansible version along with python version 2.7.14. I strongly suggest that you always use latest stable version. Here is a sample outputs from my Fedora Linux workstation:
Linux check Ansible version command

Build and install latest ansible on RPM based distro

The commands are as follows:
$ git clone
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm

Install latest ansible on a Ubuntu Linux based distro

Type the following apt-get command:
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

Install latest ansible on an Apple macOS X Unix based distro

$ brew install ansible

Install latest version of ansible on a FreeBSD

Type the following pkg command:
# pkg install ansible

Install latest version of ansible on a Fedora Linux

Run the following dnf command:
$ sudo dnf install ansible

Install latest version of ansible on an Arch Linux

Type the following pcman command:
$ sudo pcman -S ansible

Install latest version of ansible on a Debian Linux

Type the following apt command:
# echo 'deb trusty main' >> /etc/apt/sources.list
# apt-key adv --keyserver --recv-keys 93C4A3FD7BB9C367
# apt-get update
# apt-get install ansible


You can grab the latest version of Ansible by visiting this page. I also recommend that you read the official documents here.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!