Skip to content Skip to sidebar Skip to footer

Help Center

< All Topics
Print

Install Ansible – Ansible Installation in Two Easy Steps 

Infrastructure as code is made possible by the Ansible toolkit of software applications. Software provisioning, configuration management, and application deployment features are all included in the open-source suite.

 Ansible is a management tool for configuration and orchestration where software is automatically deployed in various settings. This technology functions everywhere and with everything. It is a strong, agentless tool. The platform is prepared to take on any automation issue when Red Hat’s enterprise engineering and support are added.

 Ansible can be used to provide the underlying infrastructure of any environment, virtualized hosts and hypervisors, network devices, and bare metal servers. Additionally, it may provide resources and applications inside of your cloud as well as add computer hosts and install services.

Installing Ansible

To install Ansible, an agentless automation tool, on a single host (referred to as the control node). Ansible uses a straightforward command-line interface and no databases or daemons to remotely manage a complete fleet of computers and other devices (referred to as managed nodes) from the control node via SSH, PowerShell remoting, and a variety of other protocols.

 The following are the requirements we need to install Ansible: 

  • Operating systems: Ubuntu/Debian/Linux Mint and RHEL/CentOS/Fedora
  • 2 GB RAM minimum (4+ GB RAM recommended)
  • 64-bit support required (kernel and runtime)
  • 20 GB hard disk

 Install in Two Easy Steps 

Two machines are required to install Ansible. Let’s call our first computer “Server,” which will serve as our managed node, and our second computer “Node,” which will serve as our controller node. Let’s get going now and fully comprehend the Ansible installation procedure.

 1: Install Ansible and create a user

Update the control node, as it’s crucial to make sure that your current operating version is up to date before installing any new software. Install the EPEL repository on the system after that. In CentOS, EPEL makes it simple to install frequently used packages. Now, installing the Ansible package from the EPEL repository comes next. 

On both nodes, create a non-root user who will execute our Ansible playbooks. Also, you must make sure to use the same login on both nodes (i.e., the controller node and your managed node).

 Create a user on your Controller node and set a password. Now, add the admin user and secure the Managed node with a password. 

2. Configure Admin User and create an inventory to create and run the playbook

Set up the admin user such that it has password-free access to the Managed node. After that, make sure an SSH key pair is configured for the user. Your managed nodes are listed on an inventory list that is made. To link the Managed node to the inventory, sign on to the control node as the admin user.

 Nginx will be installed on the Managed Node so that we can quickly write an Ansible playbook.

Create a file with a meaningful name after first logging in as the “ansible” user on Controller Node : install-nginx.yml in vim under home/ansible

Now, we have created our Ansible playbook. Now, enter the command ansible-playbook -i /home/admin/inventory /home/admin/install-nginx.yml on the controller node to launch the playbook.

Conclusion

This puts the ‘Ansible Installation’ article to a close. Here, we learned the definition of Ansible and how to set up the management tool. Enroll in our DevOps programme to learn more about this well-known automation tool in-depth. The course equips you for a career in DevOps by bridging the gap between operations teams and software development teams. Join us to start your learning journey!! Visit Education Nest to know more.

Table of Contents