Ansible is an open-source automation tool for configuring systems, deploying applications and running repeatable tasks. You write playbooks in YAML that list the desired state of a server, and Ansible connects over SSH, with no agent installed on the target, to bring each machine to that state.
Why it matters
Ansible lets one operator manage dozens or hundreds of servers consistently: install packages, template configuration files, restart services, rotate users. Its modules are designed to be idempotent, meaning a second run changes nothing if the system already matches. That makes it safe to re-run and useful for configuration management and for provisioning steps after a server is created.
Example
- hosts: web
become: true
tasks:
- name: Install nginx
ansible.builtin.package:
name: nginx
state: present
- name: Ensure nginx is running
ansible.builtin.service:
name: nginx
state: started
enabled: true
Run with ansible-playbook -i inventory.ini site.yml.
Common mistakes
- Using raw
shellorcommandtasks that are not idempotent when a module exists. - Putting passwords in plain text instead of using Ansible Vault.
- Not testing playbooks against a staging host first.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.