Environment
The setup used two machines:
- Control node: an Ubuntu server running Ansible.
- Managed node: a Debian server where Nginx and the Django application would run.
The goal was to move deployment preparation out of manual shell commands and into repeatable Ansible structure.
Project shape
The Ansible project followed a cookbook-style layout with roles, inventory, variables, and playbooks. I also tested using an existing community role for Nginx instead of writing every task from scratch.
The deployment preparation covered:
- installing Nginx
- placing application code
- preparing a Python virtual environment
- configuring Nginx for the Quiz_AI service
- checking that the target host could be managed consistently
Why roles matter
Roles make the playbook easier to read because each responsibility has a place. Nginx setup, application deployment, and environment preparation should not live as one long script.
Using a known role also made it easier to compare my configuration with common Ansible patterns.
Takeaway
Ansible is useful when the server setup becomes a procedure that should be repeated. The main value is not only automation; it is turning deployment knowledge into files that can be reviewed and run again.