Skip to content
Open

Lab17 #4365

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
e3eb32c
feat: implement lab01 devops info service
mpasgat Jan 28, 2026
254d12e
feat: add Java/Spring Boot implementation (bonus task)
mpasgat Jan 28, 2026
ba4bb02
feat: complete lab 2
mpasgat Feb 5, 2026
3bfbf93
feat: complete lab 2 and bonus task
mpasgat Feb 5, 2026
3eb5693
feat: complete lab03 CI and tests
mpasgat Feb 12, 2026
45a2269
fix: correct Snyk action
mpasgat Feb 12, 2026
43cbbff
fix: correct Snyk action_v2
mpasgat Feb 12, 2026
71f5858
fix: correct Snyk action_v3
mpasgat Feb 12, 2026
19da205
fix: correct Snyk action_v4
mpasgat Feb 12, 2026
bb4b007
fix: correct Snyk action_v5
mpasgat Feb 12, 2026
05c3646
report
mpasgat Feb 12, 2026
ed2a512
feat: complete lab 4 with terraform and pulumi
mpasgat Feb 19, 2026
e3ad88b
fix: trigger terraform ci only on terraform file changes
mpasgat Feb 19, 2026
c3f20dc
fix: correct terraform ci workflow syntax
mpasgat Feb 19, 2026
021fbfc
style: format terraform code
mpasgat Feb 19, 2026
b45ab26
fix(ci): use variable for ssh public key in terraform
mpasgat Feb 19, 2026
eaee89d
feat(lab04): Add files for lab 4
mpasgat Feb 21, 2026
108f9f9
feat: complete lab05 - ansible fundamentals
Feb 24, 2026
c696b2b
feat: add lab05 bonus - aws dynamic inventory
mpasgat Feb 24, 2026
5c1fee3
Lab 6: Advanced Ansible & CI/CD
mpasgat Mar 5, 2026
ee29440
fix: trigger CI on lab06 branch
mpasgat Mar 5, 2026
992d744
fix: resolve all 44 ansible-lint violations (var-naming, key-order, n…
mpasgat Mar 5, 2026
142d700
fix: restore common_deploy_user/group defaults, lint fixes
mpasgat Mar 5, 2026
7286701
linit_fix
mpasgat Mar 5, 2026
fc0cb37
fix: ssh-keyscan won't fail if VM is unreachable
mpasgat Mar 5, 2026
daaae6a
fix: use ~ for ssh key path so GitHub Actions runner can find it
mpasgat Mar 5, 2026
a106098
fix: update VM IP to 50.
mpasgat Mar 5, 2026
4c50152
fix: use printf to write SSH key, update VM IP
mpasgat Mar 5, 2026
8091aa8
fix: pin ansible<10 for Python 3.8 target; update Pulumi to Ubuntu 22.04
mpasgat Mar 5, 2026
ca9d83b
feat: lab07 - Loki stack, JSON logging, Ansible monitoring role
mpasgat Mar 9, 2026
fd71fc4
app.py r unused import json
mpasgat Mar 10, 2026
3f5c97d
feat(lab08): add Prometheus metrics stack and Ansible bonus automation
mpasgat Mar 19, 2026
7565bea
Complete lab09: Kubernetes fundamentals with ingress TLS bonus
mpasgat Mar 23, 2026
5b27a40
Harden lab09 bonus: ignore generated TLS artifacts
mpasgat Mar 23, 2026
fc8cdce
lab10: add helm charts, hooks, env values, and common library chart
mpasgat Mar 28, 2026
6ee1221
lab11: add k8s secrets, vault injector integration, and secrets docum…
mpasgat Apr 5, 2026
040d3e3
lab12: add configmaps, pvc persistence, visits endpoint, and document…
mpasgat Apr 11, 2026
4c42724
tests: use temp visits file in CI to avoid /data permission error
mpasgat Apr 16, 2026
1aee8a6
lab13: add argocd apps and applicationset
mpasgat Apr 16, 2026
d018e68
lab13: implement argocd gitops apps, multi-env sync/self-heal, and ap…
mpasgat Apr 16, 2026
9002a93
lab14: implement argo rollouts canary/blue-green with bonus analysis …
mpasgat Apr 28, 2026
255dcea
lab15: add StatefulSet with headless service, per-pod PVCs, and updat…
mpasgat May 7, 2026
a412be8
lab16 completed
mpasgat May 13, 2026
418110b
sync lab17 and lab18 from downloaded source
mpasgat May 13, 2026
94c5405
completion of lab17
mpasgat May 13, 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
107 changes: 107 additions & 0 deletions .github/workflows/ansible-deploy-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Ansible Deploy — Java App

on:
push:
branches: [master, main]
paths:
- "ansible/vars/app_java.yml"
- "ansible/playbooks/deploy_java.yml"
- "ansible/roles/web_app/**"
- ".github/workflows/ansible-deploy-java.yml"
pull_request:
branches: [master, main]
paths:
- "ansible/vars/app_java.yml"
- "ansible/playbooks/deploy_java.yml"
- "ansible/roles/web_app/**"
- ".github/workflows/ansible-deploy-java.yml"
workflow_dispatch:

permissions:
contents: read

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

jobs:
lint:
name: Ansible Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible

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

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

- name: Install Ansible and ansible-lint
run: pip install "ansible<10" ansible-lint

- name: Install required Ansible collections
run: ansible-galaxy collection install -r collections/requirements.yml

- name: Run ansible-lint on Java deploy playbook
run: ansible-lint playbooks/deploy_java.yml

deploy:
name: Deploy Java App
needs: lint
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
defaults:
run:
working-directory: ansible

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

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

- name: Install Ansible and collections
run: |
pip install "ansible<10"
ansible-galaxy collection install -r collections/requirements.yml

- name: Configure SSH for target VM
run: |
mkdir -p ~/.ssh
printf '%s' "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.VM_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true

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

- name: Deploy Java application
env:
ANSIBLE_HOST_KEY_CHECKING: "False"
run: |
ansible-playbook playbooks/deploy_java.yml \
-i inventory/hosts.ini \
--vault-password-file /tmp/vault_pass \
--extra-vars "ansible_user=${{ secrets.VM_USER }} ansible_host=${{ secrets.VM_HOST }}"

- name: Clean up sensitive files
if: always()
run: rm -f /tmp/vault_pass ~/.ssh/id_rsa

- name: Verify Java app is running
run: |
sleep 15
curl -f http://${{ secrets.VM_HOST }}:8001/health || exit 1
echo "Java app health check passed"
112 changes: 112 additions & 0 deletions .github/workflows/ansible-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Ansible Deploy — Python App

on:
push:
branches: [master, main, lab06]
paths:
- "ansible/**"
- "!ansible/docs/**"
- ".github/workflows/ansible-deploy.yml"
pull_request:
branches: [master, main]
paths:
- "ansible/**"
- "!ansible/docs/**"
- ".github/workflows/ansible-deploy.yml"
workflow_dispatch:

permissions:
contents: read

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

jobs:
# ─────────────────────────────────────────────────────────────────
# Job 1: Lint – fast feedback before any deployment is attempted
# ─────────────────────────────────────────────────────────────────
lint:
name: Ansible Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible

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

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

- name: Install Ansible and ansible-lint
run: pip install "ansible<10" ansible-lint

- name: Install required Ansible collections
run: ansible-galaxy collection install -r collections/requirements.yml

- name: Run ansible-lint on all playbooks
run: ansible-lint playbooks/*.yml

# ─────────────────────────────────────────────────────────────────
# Job 2: Deploy – only runs after lint passes
# ─────────────────────────────────────────────────────────────────
deploy:
name: Deploy Python App
needs: lint
runs-on: ubuntu-latest
# Only actually deploy on pushes to main branches (not PRs)
if: github.event_name != 'pull_request'
defaults:
run:
working-directory: ansible

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

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

- name: Install Ansible and collections
run: |
pip install "ansible<10"
ansible-galaxy collection install -r collections/requirements.yml

- name: Configure SSH for target VM
run: |
mkdir -p ~/.ssh
printf '%s' "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.VM_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true

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

- name: Deploy Python application
env:
ANSIBLE_HOST_KEY_CHECKING: "False"
run: |
ansible-playbook playbooks/deploy_python.yml \
-i inventory/hosts.ini \
--vault-password-file /tmp/vault_pass \
--extra-vars "ansible_user=${{ secrets.VM_USER }} ansible_host=${{ secrets.VM_HOST }}"

- name: Clean up sensitive files
if: always()
run: rm -f /tmp/vault_pass ~/.ssh/id_rsa

- name: Verify Python app is running
run: |
sleep 10
curl -f http://${{ secrets.VM_HOST }}:5000/health || exit 1
echo "Python app health check passed"
83 changes: 83 additions & 0 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Java CI

on:
push:
branches: ["master"]
tags: ["v*"]
paths:
- "app_java/**"
- ".github/workflows/java-ci.yml"
pull_request:
branches: ["master"]
paths:
- "app_java/**"
- ".github/workflows/java-ci.yml"
workflow_dispatch:

permissions:
contents: read

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

env:
JAVA_VERSION: "21"
DOCKER_IMAGE: "112005/devops-lab3-java"

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app_java
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
cache: "maven"

- name: Lint (Checkstyle)
run: mvn -q -DskipTests=true checkstyle:check

- name: Test
run: mvn -q test

docker:
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: app_java
file: app_java/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading