How 09anshu/infraops works
Purpose and Operating Model
This is an Ansible-based two-tier deployment lab: a WSL/Linux control node connects over SSH to an Ubuntu VM managed node and provisions web and database services. The repository also contains a prebuilt static Next.js export intended for web serving. Core entry points are site.yml, web.yml, and db.yml.
Control Plane and Targeting
Ansible runs from the control node using repository configuration and a static inventory. Target host/group selection and SSH connectivity begin at ansible.cfg and inventory/hosts.ini. The external boundary is OpenSSH from WSL to the VMware-hosted Ubuntu 24.04 managed node; credentials, host addresses, and access policy are environment-specific rather than application-managed.
Playbook Orchestration
site.yml is the likely top-level composition point for the deployment, while web.yml and db.yml separate web-server and database-server execution paths. This establishes a role-oriented control flow: select inventory hosts, apply the appropriate playbook, then execute role task graphs remotely. Paths: site.yml, web.yml, db.yml.
Web Serving Stage
The webserver role owns host setup, service configuration, and delivery of web content. Its task and handler layers define provisioning actions and service lifecycle reactions; its template provides server-rendered/configured HTML content. The deployable site artifact is under out/, including static HTML and Next.js client assets. Paths: roles/webserver/tasks/main.yml, roles/webserver/handlers/main.yml, roles/webserver/templates/index.html.j2.
Database Stage
The dbserver role independently provisions and manages the database tier. Defaults and vars provide role-scoped inputs, tasks implement the installation/configuration flow, and handlers apply service changes after state transitions. No application-level schema, ORM, or API source is present, so the database role is infrastructure-facing rather than coupled to a backend service. Paths: roles/dbserver/tasks/main.yml, roles/dbserver/handlers/main.yml, roles/dbserver/defaults/main.yml.
Static Frontend Boundary
out/ is an already-generated frontend distribution, not source for the application. It includes entry HTML (out/index.html), fallback pages, and hashed JavaScript/CSS assets under out/_next/static/. The web-server deployment boundary is therefore between Ansible-managed host configuration and these static files; runtime browser behavior executes client-side through the exported Next.js bundles. Paths: out/index.html, out/_next/static, out/_not-found.html.
Runtime and Infrastructure
Material runtimes are Ansible/Python on the control node, SSH on the transport boundary, Ubuntu on VMware as the managed runtime, and a web/database service pair configured by roles. VS Code Remote WSL/SSH is a development interface only. Role metadata and defaults make each service role independently reusable while inventory/playbooks bind them to this lab environment. Paths: roles/webserver/meta/main.yml, roles/dbserver/meta/main.yml, inventory/hosts.ini.
Main entry points: tasks/main.yml Webserver Tasks · tasks/main.yml Database Tasks · site.yml Site Playbook · hosts.ini Static Inventory
Components 19
Ansible Control Node
WSL/Linux runs Ansible and selects managed hosts.
- Ansible Configuration
ansible.cfg - Static Inventory
inventory/hosts.ini - Site Playbook · Top-level deployment composition.
site.yml - Web Playbook
web.yml - Database Playbook
db.yml
Ubuntu Managed Node
Ubuntu 24.04 VM hosts the provisioned service tiers.
- Webserver Tasks · Provisions web host and deploys content.
roles/webserver/tasks/main.yml - Web Service Handlers · Applies web service lifecycle changes.
roles/webserver/handlers/main.yml - Web Template
roles/webserver/templates/index.html.j2 - Web Role Metadata · Supports independent role reuse.
roles/webserver/meta/main.yml - Web Service · Serves configured HTML and static frontend files.
- Database Tasks · Installs and configures the database tier.
roles/dbserver/tasks/main.yml - Database Defaults
roles/dbserver/defaults/main.yml - Database Service Handlers · Applies database service changes.
roles/dbserver/handlers/main.yml - Database Role Metadata · Supports independent role reuse.
roles/dbserver/meta/main.yml - Database Service · Infrastructure-facing database with no application schema or API layer.
Static Frontend Export
Prebuilt Next.js distribution served as static content.
- Static Entry HTML
out/index.html - Next.js Client Assets · Hashed JavaScript and CSS executed in the browser.
out/_next/static - Static Fallback Page
out/_not-found.html
Other components
- OpenSSH Boundary · Environment-managed SSH access from WSL to the VM.
Connections 17
- Ansible Configuration → Static Inventory: loads
- Static Inventory → OpenSSH Boundary: targets host over
- Site Playbook → Web Playbook: composes
- Site Playbook → Database Playbook: composes
- Web Playbook → OpenSSH Boundary: executes through
- Database Playbook → OpenSSH Boundary: executes through
- OpenSSH Boundary → Webserver Tasks: runs remotely
- OpenSSH Boundary → Database Tasks: runs remotely
- Webserver Tasks → Web Template: renders
- Webserver Tasks → Web Service Handlers: notifies
- Web Service Handlers → Web Service: manages
- Static Entry HTML → Web Service: deployed for serving
- Next.js Client Assets → Static Entry HTML: referenced by
- Static Fallback Page → Web Service: served as fallback
- Database Defaults → Database Tasks: configures
- Database Tasks → Database Service Handlers: notifies
- Database Service Handlers → Database Service: manages