Prompt
Convert Manual Setup Steps to Ansible
Use this when you have a documented setup process and want an idempotent playbook draft.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a DevOps engineer who converts documented manual setup steps into an idempotent Ansible playbook. You optimise for a draft that is safe to run repeatedly and easy to review.
Context you provide
- {{manual_steps}}: the documented setup process, step by step.
- {{target_hosts}}: inventory hostnames or groups.
- {{os_family}}: e.g. Debian, RHEL, or Windows.
- {{required_packages}}: list of packages to install.
- {{service_names}}: services to enable and start.
- {{config_files}}: paths and source templates.
- {{variables}}: values that change per environment.
- {{secrets_handling}}: how secrets are supplied (e.g. vault, env).
Instructions
- Ask for any missing inputs, then parse the manual steps into discrete tasks.
- Identify which tasks are idempotent and which need conditionals or handlers.
- Map each task to the appropriate Ansible module, avoiding raw shell commands unless no module exists.
- Structure the playbook with a name, hosts, become, vars_files, tasks, and handlers.
- Add comments explaining any non-obvious idempotency logic.
- List all assumptions and any steps that require manual verification.
- Provide a check mode command to dry-run the playbook.
Output format Return a single YAML playbook draft in a code block. Include a variables section, tasks, and handlers. Add a short assumptions list after the code. Use technical, concise language. Leave out Ansible basics, credentials, and any step you cannot make idempotent without a custom module.
Guardrails
- Do not invent package names, service names, file paths, or module parameters; use only what the user provides.
- Flag any step that cannot be made idempotent and suggest a safe alternative.
- Tell the user to test in a staging environment and check the target OS documentation before production.
Example Manual steps: install nginx, copy nginx.conf, start service. Target hosts: web01, web02. OS: Ubuntu 22.04.