LinuxUnity LinuxUnity

Posts / Ansible

[Ansible] Part 1: Introduction to Ansible

What is Ansible? Ansible is a popular configuration automation tool that simplifies infrastructure management and deployment.

11/07/2026 3 min read 13 views

Z Zedx

In this article

What is Ansible?

Ansible is a prominent and widely used infrastructure automation and configuration management tool. It is a free open-source platform developed by RedHat .

Compared with other tools offering similar functionality, Ansible is much easier to learn and more accessible. It also has a larger user community than other tools.

You can think of it this way: an administrator only needs to declare the server address information and the actions to be performed on the remote server in Ansible, then run the playbook they have written and wait for it to complete.

minh hoạ ansible

Key Features of Ansible

Ansible enables centralized installation management and system configuration, as well as the execution of administrative commands.

This tool is agentless, meaning that no software needs to be installed on remote servers.

It uses SSH on Linux and PowerShell on Windows to establish connections to remote servers, helping enhance security.

Ansible modules are written in Python to manage systems. Ansible also uses JSON to display information and YAML (Yet Another Markup Language) to define system configurations in a structured format.

When idle, with no tasks to execute, Ansible does not consume control server resources because it does not use daemons or programs running in the background. System resources are used only when Ansible commands are executed.

Ansible can be used through ad hoc commands or Ansible Playbooks. It can also be deployed with graphical user interfaces such as Ansible Tower (paid), Ansible AWX (free), or through plugins for Jenkins,…

Ansible Components and How They Work

There are five main components involved in Ansible's workflow:

Inventory is a text file that describes hosts and servers, along with information such as usernames, passwords, IP addresses,…

Module is a unit/component that performs a task. Ansible currently has more than 2,000 modules for performing various operations, such as installing applications, updating configuration files, setting file permissions on remote servers,…

Playbook is a file that defines what needs to be done. In other words, it contains the scripts and tasks to be executed on remote servers.

Ansible Config is where Ansible configuration variables are defined. This file can be used to change default settings or override variables.

Finally, there is Python. Ansible does not actually bundle Python. However,  Ansible uses Python to assemble the components listed above into a package and send it to the remote system.

So, how does Ansible work?

ansible hoạt động như thế nào

Ansible establishes an SSH connection to the remote system and deploys the package using the Ansible configuration and parameters provided by the administrator. In other words,  it copies the package to a temporary directory created on the remote machine.

The Python framework on the remote system executes the package. When execution is complete,  the remote system returns the results to Ansible in JSON format to report the status of the execution process.

Before the SSH connection is closed, the previously transferred Python package is deleted from the temporary directory on the remote system.

Applications

Ansible has many applications in software deployment and system administration.

  • Provisioning: Create VMs and containers at scale in cloud environments via APIs (OpenStack, AWS, Google Cloud, Azure, etc.).
  • Configuration Management: Centrally manage service configurations without having to manually modify the configuration on each server.
  • Application Deployment: Deploy applications at scale and efficiently manage the application lifecycle from development through production.
  • Security & Compliance: Consistently manage information security policies across multiple environments and products (deploy policies, configure firewalls at scale across multiple servers, etc.).

Series: Ansible · Part 1/8

  1. Intro Automation in Linux Configuration Management
  2. Part 1 [Ansible] Part 1: Introduction to Ansible
  3. Part 2 [Ansible] Part 2: Installing and Getting Started with Ansible
  4. Part 3 [Ansible] Part 3: How to Create and Manage Inventory Effectively in Ansible
  5. Part 4 [Ansible] Part 4: Exploring Commonly Used Modules in Ansible
  6. Part 5 [Ansible] Part 5: A Beginner’s Guide to Writing Simple, Effective Playbooks
  7. Part 6 [Ansible] Part 6: Writing an Ansible Playbook to Install WordPress on a LAMP Stack
  8. Part 7 [Ansible] Part 7: Install Ansible CMDB and Create System Reports in Minutes

Related posts