DevOps & Cloud

ansible

Write a to-do list for your servers once, and Ansible does the chores on all of them, every time, without complaint.

Install it: pip install ansible

What does it do?

Imagine having a thousand computers that all need the same software installed and the same settings applied — Ansible is the checklist-following robot that does it for you, in plain text files a human can actually read. You describe the desired end state, such as this server should have Python 3.11 and this configuration file, and Ansible figures out how to get there, connecting over SSH without needing any special software pre-installed on the target machines. It’s less a Python library you import and more a full automation tool written in Python, which is why IT teams treat it like a Swiss Army knife for server management.

See it in action

This is an automation instruction sheet (a playbook) that tells a group of servers labeled ‘webservers’ to install and start the nginx web server software.

---
- name: Set up web servers
  hosts: webservers
  become: true
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present

    - name: Start nginx
      service:
        name: nginx
        state: started

Why would a non-developer care?

Every time a company rolls out a security patch to thousands of servers overnight, or spins up new infrastructure for a launch without hiring an army of engineers, tools like Ansible are quietly doing the heavy lifting. It’s part of why the internet mostly stays online despite running on millions of individual, fallible machines.

Real-world examples

Ansible was created by Michael DeHaan in 2012 and acquired by Red Hat in 2015, and it’s since been used by organizations ranging from research institutions to major banks to configure and patch server fleets. Without automation like this, IT teams would be manually logging into each server one by one, a process that doesn’t scale past a handful of machines, let alone thousands.

Who uses it

System administrators and DevOps teams automating server setup, configuration, and software deployment across many machines at once.

How it compares to alternatives

Its closest rivals are Puppet and Chef, both older and both requiring special agent software installed on every managed machine — Ansible’s big selling point was working over plain SSH with nothing to install. Terraform, by contrast, focuses on creating infrastructure like servers and networks rather than configuring what runs on it.

Fun fact

Ansible is named after a fictional instant-communication device from Ursula K. Le Guin’s science fiction novels, fitting for a tool that instantly commands many machines at once.

New to Python and want to actually try libraries like this yourself?

Find a beginner-friendly course

Related libraries