Playbooks
Automation workflows and tasks
Roles
Reusable automation content
Inventory
Host and group management
Understanding Ansible
Ansible is an open-source automation tool that simplifies configuration management, application deployment, and task automation...
Key Features
- Agentless Architecture
- YAML-based Playbooks
- Idempotency
- Extensive Module Library
Basic Ansible Examples
Simple Playbook
---
- name: Install and Configure Web Server
hosts: webservers
become: yes
tasks:
- name: Install Apache
apt:
name: apache2
state: present
- name: Start Apache Service
service:
name: apache2
state: started
enabled: yes
Common Commands
ansible-playbook playbook.yml
- Run a playbookansible-galaxy init role_name
- Create a new roleansible all -m ping
- Test connectivityansible-vault create secret.yml
- Encrypt sensitive data