Ansible Installation on RedHat/CentOs
The easiest way to install Ansible is by adding EPEL (Extra Packages for Enterprise Linux) repository.
Run below command to add epel repository.
$ sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Verify the epel repository
$ sudo yum repolist |grep epel epel/x86_64 Extra Packages for Enter 12,353
After epel repository added, we can install Ansible using yum.
$ sudo yum install ansible -y
Verify Ansible version
$ ansible --version
Ansible Installation on Ubuntu/Debian
Install software-properties-common and add ansible to apt repository.
$ sudo apt-get install software-properties-common $ sudo apt-add-repository ppa:ansible/ansible
Update the apt repository and install Ansible.
$ sudo apt-get update $ sudo apt-get install ansible
Verify Ansible version
$ ansible --version