Architect the Project: Roles & Inventory
Lay out the full deployment repo.
Architect the Project: Roles & Inventory is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 1 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.
The Capstone Goal
Time to ship a real multi-tier app with a rolling deploy and zero downtime. First step: design the project layout. 🚀
Think in Roles
Break the system into roles: one per concern like common, web, app, db and loadbalancer. Each is reusable and testable on its own.
The Top-Level Layout
A clean repo keeps inventory, group_vars, roles and a site.yml entry playbook at the root, so anyone can find things fast.
deploy/
site.yml
inventory/
group_vars/
host_vars/
roles/site.yml Ties It Together
Your master playbook site.yml imports per-tier plays in order. It is the single command that deploys the whole stack.
- import_playbook: plays/loadbalancer.yml
- import_playbook: plays/db.yml
- import_playbook: plays/app.yml
- import_playbook: plays/web.ymlMap Tiers to Groups
Your inventory defines a group per tier: lb, db, app and web. Each play targets exactly the hosts it owns.
[lb]
lb1
[web]
web1
web2
[app]
app1
app2
[db]
db1group_vars per Tier
Store tier settings in group_vars: web ports, app version, db credentials. Hosts inherit them automatically, no copy-paste.
group_vars/web.yml:
nginx_port: 80
upstream: app:8080host_vars for Specials
When one host differs, put overrides in host_vars. The primary db, for example, may carry replication settings the rest lack.
host_vars/db1.yml:
postgresql_role: primaryPin the App Version
Make the release version a variable, not a hardcoded string. One change point lets you roll forward or back in seconds.
group_vars/all.yml:
app_version: "2.4.1"Separate Environments
Keep inventory folders per environment so staging and production never share hosts. Same roles, different targets.
inventory/
staging/hosts
production/hostsLock Your Dependencies
List external Galaxy roles in requirements.yml so every teammate and CI run installs the exact same automation code.
roles:
- name: geerlingguy.nginx
version: 3.1.4Architecture First Pays Off
A thoughtful layout turns a scary deploy into a few predictable commands. Structure now saves you firefighting later. 🧱
Quick Check
Let us place one piece of config correctly.
Recap
You designed the repo: roles per tier, inventory groups, group_vars and host_vars, and a site.yml that runs the whole deploy. ✅
Learn DevOps Bootcamp with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 142
- Lessons
- 568
Frequently Asked Questions
Is the “Architect the Project: Roles & Inventory” lesson free?
Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Architect the Project: Roles & Inventory”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.
What will I learn in “Architect the Project: Roles & Inventory”?
Lay out the full deployment repo. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.
How long does the “Architect the Project: Roles & Inventory” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Architect the Project: Roles & Inventory
- Provision, Harden & Bootstrap Hosts
- Rolling Deploy Behind the Load Balancer
- Smoke Tests, Rollback & Notifications