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:
ansible 2.4.0.0 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 2.4.0.0 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:
Another outputs from Ubuntu Linux 19.10 desktop:
ansible 2.8.3 config file = /etc/ansible/ansible.cfg configured module search path = ['/home/vivek/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.7.5rc1 (default, Oct 2 2019, 04:19:31) [GCC 9.2.1 20190909]
Build and install latest ansible on RPM based distro
The commands are as follows:
$ git clone https://github.com/ansible/ansible.git
$ 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
First, install Homebrew on macOS and then type the following brew command:
$ 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 http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main' >> /etc/apt/sources.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
# apt-get update
# apt-get install ansible
Conclusion
You can grab the latest version of Ansible by visiting this page. I also recommend that you read the official documents here.
🐧 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |