Ansible Core Concepts
This page covers the few Ansible ideas you should understand before writing playbooks.
Main Concepts
- Inventory The hosts and groups Ansible manages.
- Playbooks YAML files that describe the automation workflow.
- Modules Built-in actions for tasks such as installing packages, copying files, and managing services.
- Roles Reusable playbook structure for larger projects.
How These Pieces Work Together
The usual flow is simple:
- Define servers in an inventory.
- Write a playbook with tasks.
- Use modules inside those tasks.
- Move repeated logic into roles as the project grows.
Practical Starting Point
If you are new to Ansible, start with:
- One inventory file
- One small playbook
- A few built-in modules such as
ping,apt,copy, andservice
Quick Check
ansible all -m ping -i inventory.ini
ansible-playbook -i inventory.ini playbook.yml --check