Ansible Setup and Installation

Ansible installation
In this section, we will learn how to install Ansible and set up an Ansible lab environment to play around with Ansible.

For the purpose of this entire course, you will need three Linux VMs with the following configurations:

System NameIP AddressOperating System
Ansible Controller192.168.0.10CentOS 7/8
Target1192.168.0.11CentOS 7/8
Target2192.168.0.12CentOS 7/8

I assume you have now all three systems up and running. The next step is to install Ansible on the Ansible Controller machine.

Log in to your Ansible Controller machine and install the Ansible by running the following command:

1
2
yum install epel-release -y
yum install ansible -y

Once the installation has been completed, you can run the following command to confirm that the Ansible installed on your system.

1
ansible --version

You should see the following output:

1
2
3
4
5
6
ansible 2.9.10
  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.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Nov 21 2019, 19:31:34) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]

For Debian/Ubuntu based operating systems, you can install the Ansible with the following command:

1
apt-get install ansible -y

After the successful Ansible installation, you can proceed to the next chapter.

For more information about the Ansible installation, visit the Ansible official installation documentation.

You should also read the following chapters:
      1. Introduction
      3. Ansible Inventory
      4. Introduction to YAML
      5. Ansible Playbooks
      6. Ansible Modules
      7. Ansible Variables
      8. Ansible Conditionals and Loops
      9. Ansible Roles
   10. Project

 

About Hitesh Jethva

I am Hitesh Jethva Founder and Author at LinuxBuz.com. I felt in love with Linux when i was started to learn Linux. I am a fan of open source technology and have more than 15+ years of experience in Linux and Open Source technologies.

View all posts by Hitesh Jethva