Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7ff55d7
Update README.md
Cre-eD May 15, 2025
a057c02
Publish labs 01-06
Cre-eD Jan 7, 2026
2fbd476
Add lectures 11-16, quizzes & update lab18 landing page
Cre-eD Jan 17, 2026
9a363bf
Updated Looking Ahead with correct lab descriptions
Cre-eD Jan 17, 2026
e391e97
Updated the Course Completion section to mention 16-18 labs
Cre-eD Jan 17, 2026
888cd53
Updated the duration badge
Cre-eD Jan 17, 2026
2b850a9
Removed duplicates and updated all references
Cre-eD Jan 17, 2026
c871131
Updated lab1
Cre-eD Jan 18, 2026
d57fde0
Update lecs
Cre-eD Jan 22, 2026
712fbed
Complete lab1
ostxxp Jan 27, 2026
93475b6
complete lab 2
ostxxp Feb 4, 2026
514face
feat(lab03): add CI and badge
ostxxp Feb 11, 2026
6669194
docs(lab03): complete documentation
ostxxp Feb 11, 2026
e62d7d6
Add lab4
ostxxp Feb 16, 2026
c8eea87
chore: remove terraform providers from repo and update gitignore
ostxxp Feb 16, 2026
821ffe8
edit `.gitignore`
ostxxp Feb 16, 2026
dde21db
complete lab05
ostxxp Feb 22, 2026
0bd2b31
Complete Lab 6: Advanced Ansible & CI/CD
ostxxp Feb 24, 2026
4d8d5c7
feat: add centralized logging stack with grafana loki and promtail
ostxxp Mar 11, 2026
63bd08b
fix: update github actions triggers for labs 4-7
ostxxp Mar 11, 2026
5c61016
ci: add ansible and terraform workflows
ostxxp Mar 11, 2026
cd91b83
fix: add ansible vault password to deploy workflow
ostxxp Mar 11, 2026
c5d5233
fix: use webservers group in ansible deploy workflow
ostxxp Mar 11, 2026
ccb1122
fix: build amd64 docker image with correct app name
ostxxp Mar 11, 2026
03cae13
fix: increase app startup wait time in ansible deploy
ostxxp Mar 11, 2026
52c87f8
fix: use repo ssh public key for terraform validate
ostxxp Mar 12, 2026
a62944a
lab08: add prometheus monitoring stack
ostxxp Mar 17, 2026
5c4f1db
ci: enable workflow for lab08 branch
ostxxp Mar 17, 2026
0a539a6
ci: fix invalid workflow condition
ostxxp Mar 17, 2026
bce6b6b
ci: fix workflow syntax and support all lab branches
ostxxp Mar 17, 2026
1b638d3
lab09: add kubernetes manifests and documentation
ostxxp Mar 20, 2026
8d47195
ci: trigger workflow for k8s changes
ostxxp Mar 20, 2026
d902e82
lab10: add helm chart for app deployment
ostxxp Apr 1, 2026
c59ca3e
lab11: secrets + vault integration
ostxxp Apr 1, 2026
f9c302e
lab12: add configmaps and persistent volumes
ostxxp Apr 1, 2026
ecf381a
lab13: fix nodePort conflict
ostxxp Apr 18, 2026
d44b0bd
lab13: add argocd dev and prod applications
ostxxp Apr 18, 2026
2fa7f32
lab13: add argocd application manifests and documentation
ostxxp Apr 18, 2026
ecd9cac
lab14: add canary rollout
ostxxp Apr 30, 2026
8511a97
lab14: argo rollouts canary deployment
ostxxp Apr 30, 2026
4558b6f
lab15: add statefulset with per-pod storage
ostxxp May 3, 2026
272e363
lab16: add monitoring and init containers
ostxxp May 3, 2026
dbd362c
merge lab16 into lab17
ostxxp May 4, 2026
86d6d1f
lab17: add cloudflare workers edge api
ostxxp May 4, 2026
4fe51c9
docs: add lab18 submission - Nix reproducible builds
ostxxp May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/ansible-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Ansible Deploy

on:
push:
branches:
- main
- master
- lab6
- lab06
- lab7
- lab07
paths:
- "ansible/**"
- ".github/workflows/ansible-deploy.yml"
pull_request:
paths:
- "ansible/**"
- ".github/workflows/ansible-deploy.yml"

concurrency:
group: ansible-deploy-${{ github.ref }}
cancel-in-progress: true

jobs:
syntax-check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Ansible
run: |
python -m pip install --upgrade pip
pip install ansible

- name: Write vault password file
run: |
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > ~/.vault_pass.txt
chmod 600 ~/.vault_pass.txt

- name: Show Ansible version
run: ansible --version

- name: Syntax check provision playbook
working-directory: ansible
run: ansible-playbook -i inventory/hosts.ini playbooks/provision.yml --syntax-check --vault-password-file ~/.vault_pass.txt

- name: Syntax check deploy playbook
working-directory: ansible
run: ansible-playbook -i inventory/hosts.ini playbooks/deploy.yml --syntax-check --vault-password-file ~/.vault_pass.txt

deploy:
needs: syntax-check
if: github.event_name == 'push'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "${{ secrets.SERVER_HOST }}" >> ~/.ssh/known_hosts

- name: Write vault password file
run: |
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > ~/.vault_pass.txt
chmod 600 ~/.vault_pass.txt

- name: Write inventory from secrets
run: |
cat > ansible/inventory/hosts.ini <<INVENTORY
[webservers]
app-server ansible_host=${{ secrets.SERVER_HOST }} ansible_user=${{ secrets.SERVER_USER }} ansible_ssh_private_key_file=~/.ssh/id_rsa
INVENTORY

- name: Install Ansible
run: |
python -m pip install --upgrade pip
pip install ansible

- name: Run provision playbook
working-directory: ansible
run: ansible-playbook -i inventory/hosts.ini playbooks/provision.yml --vault-password-file ~/.vault_pass.txt

- name: Run deploy playbook
working-directory: ansible
run: ansible-playbook -i inventory/hosts.ini playbooks/deploy.yml --vault-password-file ~/.vault_pass.txt
87 changes: 87 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Python CI (Lab03)

on:
push:
branches:
- main
- master
- "lab*"
paths:
- "app_python/**"
- "monitoring/**"
- "ansible/**"
- "k8s/**"
- "playbooks/**"
- "app-python-chart/**"
- ".github/workflows/python-ci.yml"
pull_request:
paths:
- "app_python/**"
- "monitoring/**"
- "ansible/**"
- "k8s/**"
- "playbooks/**"
- ".github/workflows/python-ci.yml"

concurrency:
group: python-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app_python

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "app_python/requirements.txt"

- name: Install deps
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Lint (ruff)
run: ruff check .

- name: Tests
run: pytest -q

docker-build-push:
needs: test-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set version (CalVer)
run: |
echo "CALVER=$(date +%Y.%m)" >> $GITHUB_ENV
echo "BUILD=${{ github.run_number }}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build & Push
uses: docker/build-push-action@v6
with:
context: ./app_python
file: ./app_python/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/devops-lab02-python:${{ env.CALVER }}.${{ env.BUILD }}
${{ secrets.DOCKER_USERNAME }}/devops-lab02-python:latest
49 changes: 49 additions & 0 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Terraform CI

on:
push:
branches:
- main
- master
- lab4
- lab04
- lab5
- lab05
- lab6
- lab06
- lab7
- lab07
paths:
- "terraform/**"
- ".github/workflows/terraform-ci.yml"
pull_request:
paths:
- "terraform/**"
- ".github/workflows/terraform-ci.yml"

concurrency:
group: terraform-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
terraform-checks:
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3

- name: Terraform fmt check
run: terraform fmt -check -recursive

- name: Terraform init
run: terraform init -input=false

- name: Terraform validate
run: terraform validate
12 changes: 12 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[defaults]
result_format = yaml
inventory = inventory/hosts.ini
roles_path = roles
host_key_checking = False
retry_files_enabled = False
interpreter_python = auto_silent

[privilege_escalation]
become = True
become_method = sudo
become_user = root
142 changes: 142 additions & 0 deletions ansible/docs/LAB05.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# LAB05 --- Ansible Fundamentals

## 1. Architecture Overview

**Control node:** macOS (Apple Silicon M1), Ansible running locally in a
Python virtual environment\
**Target host:** Ubuntu 24.04 LTS virtual machine\
**Automation approach:** role-based Ansible architecture

This project uses a modular Ansible role structure to provision
infrastructure and deploy a containerized Python application. Roles
separate responsibilities into reusable components, making automation
easier to maintain, reuse, and scale.

Project structure:

ansible/
├── ansible.cfg
├── inventory/
│ └── hosts.ini
├── playbooks/
│ ├── provision.yml
│ └── deploy.yml
├── roles/
│ ├── common/
│ ├── docker/
│ └── web_app/
├── group_vars/
│ └── all.yml (encrypted with Ansible Vault)
└── docs/
└── LAB05.md

Roles were used instead of a single playbook because roles improve
modularity, readability, and reusability.

------------------------------------------------------------------------

## 2. Roles Documentation

### Role: common

**Purpose:** Base system provisioning.

Tasks performed:

- Waits for apt lock release
- Updates apt cache
- Installs essential packages
- Sets timezone

------------------------------------------------------------------------

### Role: docker

**Purpose:** Install and configure Docker.

Tasks performed:

- Adds Docker repository and GPG key
- Installs Docker Engine
- Starts and enables Docker service
- Adds user to docker group

------------------------------------------------------------------------

### Role: web_app

**Purpose:** Deploy containerized application.

Tasks performed:

- Logs in to Docker Hub using Vault credentials
- Pulls Docker image
- Starts container
- Performs health check

------------------------------------------------------------------------

## 3. Idempotency Demonstration

First run:

changed=5

Second run:

changed=0

This proves the playbook is idempotent.

------------------------------------------------------------------------

## 4. Ansible Vault Usage

Vault file:

group_vars/all.yml

Used to store:

- Docker Hub username
- Docker Hub access token

Vault ensures secrets are encrypted and secure.

------------------------------------------------------------------------

## 5. Deployment Verification

Container running:

docker ps

Output:

ostxxp/devops-lab02-python:latest
0.0.0.0:5000->5000/tcp

Health check:

HTTP/1.1 200 OK
{"status":"healthy"}

------------------------------------------------------------------------

## 6. Key Decisions

Roles were used to improve modularity and reusability.

Handlers ensure services restart only when needed.

Vault protects sensitive credentials.

Tasks are idempotent to ensure consistent infrastructure state.

------------------------------------------------------------------------

## Conclusion

Infrastructure provisioning and deployment were successfully automated
using Ansible roles, Vault, and Docker. The deployment is secure,
modular, and idempotent.
Loading
Loading