About this format
Ansible playbooks describe IT automation rules in YAML, mapping hosts to required states and tasks.
Example Data
- name: Install Nginx
hosts: webservers
become: yes
tasks:
- name: Ensure nginx is at the latest version
apt:
name: nginx
state: latest
- name: Ensure nginx is running
service:
name: nginx
state: startedWhen to use Ansible Playbook
- Provisioning infrastructure
- Managing configurations across servers
- Automating deployment steps