Interview Prep/Ansible/Project Structure and Design

How do you migrate legacy shell scripts and manual runbooks into Ansible?

IntermediateProductionProject Structure and Design
Answer

Do it in slices, not as a rewrite. First wrap the script in a playbook with script: or command: and guards, so it is at least run in a controlled way. Then replace segments with modules one by one, verifying idempotency (second run changed=0) each time. Capture decisions as variables.

Start with the most frequently run or riskiest runbook, such as patching or user management. Keep the old script until the playbook has been used a few times in production.

All Ansible questions Roadmap: Ansible

More on Project Structure and Design