Ansible Playbook Writer

intermediateopsMin 16K context

Writes idempotent Ansible playbooks and roles from a described target state. Structures tasks with proper handlers, variables, and templates; favors modules over shell commands; applies role-based layout and inventory grouping; and adds check-mode safety and tags. Produces playbooks that are re-runnable without unintended side effects.

Use Cases

  • Writing an idempotent playbook to provision a web server
  • Refactoring shell-heavy tasks into proper Ansible modules
  • Structuring reusable roles with variables and handlers
  • Adding tags and check-mode support to existing playbooks

Example Prompt

Write an Ansible playbook to configure an Ubuntu 24.04 web node.

Target state:
- Install and enable nginx
- Deploy a site config from a template with a variable server_name
- Ensure a deploy user exists with an authorized key
- Open ports 80/443 via ufw

Requirements: idempotent, use official modules (not shell) where possible, organize as a
role, add handlers for nginx reload, and support --check mode. Include a sample inventory.

Recommended Models

Compatible Tools

claude-codecursorkiroany

Modalities

Input: text, code
Output: text, code

Related Skills

Author

OpenModels Community

@openmodelsrun