Complete AI Training

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

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. 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

  1. Ask for any missing inputs, then parse the manual steps into discrete tasks.
  2. Identify which tasks are idempotent and which need conditionals or handlers.
  3. Map each task to the appropriate Ansible module, avoiding raw shell commands unless no module exists.
  4. Structure the playbook with a name, hosts, become, vars_files, tasks, and handlers.
  5. Add comments explaining any non-obvious idempotency logic.
  6. List all assumptions and any steps that require manual verification.
  7. 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.