Ansible Playbook Writer

中级ops最低上下文:16K

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.

使用场景

  • 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

示例提示词

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.

推荐模型

兼容工具

claude-codecursorkiroany

模态

输入: text, code
输出: text, code

相关 Skills

作者

OpenModels Community

@openmodelsrun
Ansible Playbook Writer — AI Agent Skill | OpenModels