Basic Nginx Playbook
- name: Install nginx
hosts: webservers
become: yes
tasks:
- apt: name=nginx state=present update_cache=yes
- systemd: name=nginx state=started enabled=yes
💡 Ansible is idempotent: run the same playbook 10 times and the result stays consistent.