How to Install Ansible

Install Ansible for Configuration Automation

Ansible is a powerful open-source automation tool that helps you automate IT infrastructure and application deployment. It is written in Python and is agentless, meaning it doesn't require any software to be installed on the machines you want to manage. Ansible uses a simple YAML-based language to define the desired state of your systems, and then it automatically takes the necessary steps to achieve that state.

Ansible requires a Control Node that connects with the managed hosts thought ssh to make the desired changes. Installation is done in the Control Node and this node installs the needed packages in the managed hosts when needed.

How to install Ansible on Ubuntu

  1. Install Ansible on the Control Node

    Install Ansible using apt.

  2. Check Ansible Installation

    Check that Ansible has been installed.

  3. Next Steps

    Use Ansible with Terraform for configuration management.


The Ansible Control Node is the central machine within an Ansible environment responsible for executing automation tasks on managed hosts. It acts as the brains of the operation, housing the Ansible software and managing the communication and execution of playbooks.

To install follow the official installation instructions or run the following apt commands for installation on Ubuntu.

$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt update
$ sudo apt install ansible

Check Ansible Installation

Check that the Ansible has been installed.

$ ansible --version
ansible [core 2.16.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Next Steps

Check the tutorial How To Use Ansible and Terraform Together.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Cloud Tutorials

Control traffic to AWS resources using security groups
How to configure and use the Terraform aws_security_group and aws_security_group_rule resource blocks to create and manage AWS Security Groups and secure the infrastructure.
AWS Routing Tables with Terraform
How to configure and use the Terraform aws_route_table, aws_route, and aws_main_route_table_association resource blocks to create and manage AWS Routing Tables.
AWS NAT Gateway
How to configure and use the Terraform aws_nat_gateway and aws_eip resource blocks to create and manage AWS NAT Gateway and its corresponding Public IPs inside each availability zone to enable Internet access from instances in private subnets.
AWS Internet Gateway
How to configure and use the Terraform aws_internet_gateway resource block to create and manage AWS Internet Gateway inside a VPC to enable instances access to and from the Internet.
How to configure and use the Terraform aws_subnet resource block to create and manage AWS Subnets inside a VPC. AWS Subnets are a subdivision of the IP Network assigned to the VPC.
Javier Ruiz Cloud and SaaS Expert

Javier Ruiz

IT Wonder Lab tutorials are based on the diverse experience of Javier Ruiz, who founded and bootstrapped a SaaS company in the energy sector. His company, later acquired by a NASDAQ traded company, managed over €2 billion per year of electricity for prominent energy producers across Europe and America. Javier has over 25 years of experience in building and managing IT companies, developing cloud infrastructure, leading cross-functional teams, and transitioning his own company from on-premises, consulting, and custom software development to a successful SaaS model that scaled globally.

Are you looking for cloud automation best practices tailored to your company?

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram