Ansible Interactive Playground
Write, test, and learn Ansible with real-time feedback and comprehensive examples!
Real-time Validation
Save & Load
Execution History
25+ Examples
Code Snippets
Save Playbook
Load Saved
Snippets
History
Tutorial Mode
Export
Playbook Editor
---
- name: My First Playbook
hosts: localhost
gather_facts: yes
tasks:
- name: Print a message
debug:
msg: "Hello from Ansible!"
- name: Show system information
debug:
msg: "Running on "
Inventory
localhost ansible_connection=local
Note: For security, playbooks run in check mode (dry-run). No actual changes are made to the system.
Output
Waiting for playbook execution...
- Use
debugmodule to print messages and variables - Start with
gather_facts: yesto access system info - Use
whenconditions to control task execution - Use
looporwith_itemsfor iteration - Keep indentation consistent (2 spaces recommended)
- Use
become: yesfor sudo operations
- Ctrl/Cmd + / - Comment/uncomment lines
- Ctrl/Cmd + F - Find in editor
- Ctrl/Cmd + H - Find and replace
- Ctrl/Cmd + S - Save playbook
- Ctrl/Cmd + Enter - Run playbook
- Tab - Auto-indent (use 2 spaces for YAML)
- Ctrl/Cmd + D - Duplicate line