Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
88e4200
feat: implement lab01 devops info service
angel-palkina Jan 28, 2026
15cb227
Merge pull request #1 from angel-palkina/lab1
angel-palkina Feb 4, 2026
7774269
feat: containerize python app with docker
angel-palkina Feb 4, 2026
0ba3d2a
Merge branch 'lab2' of https://github.com/angel-palkina/DevOps-Core-C…
angel-palkina Feb 4, 2026
4ed571a
Merge pull request #2 from angel-palkina/lab02
angel-palkina Feb 4, 2026
77f3a33
feat: add pipline and tests of app.py
angel-palkina Feb 11, 2026
c1b7f83
docs: add LAB03
angel-palkina Feb 11, 2026
be83cd9
Merge pull request #3 from angel-palkina/lab03
angel-palkina Feb 11, 2026
6f008a1
Merge branch 'inno-devops-labs:master' into master
angel-palkina Feb 18, 2026
ae16d00
feat: add Terraform infrastructure for Yandex Cloud VM
angel-palkina Feb 19, 2026
f65a9b3
git commit -m "feat: add Pulumi infrastructure with Yandex Cloud prov…
angel-palkina Feb 19, 2026
63e85ff
docs: complete Lab 04 documentation with all required sections
angel-palkina Feb 19, 2026
6d69f94
refactor: add path filters to Python CI workflow
angel-palkina Feb 19, 2026
f55587b
Merge pull request #4 from angel-palkina/lab04
angel-palkina Feb 19, 2026
590fc9f
feat: add Terraform CI/CD workflow
angel-palkina Feb 19, 2026
995a1c9
fix: correct Terraform version in CI workflow
angel-palkina Feb 19, 2026
fd34b61
fix: make provider config CI-friendly
angel-palkina Feb 19, 2026
77d00f2
docs: add comprehensive Lab 04 Bonus documentation
angel-palkina Feb 19, 2026
e13396b
Merge pull request #5 from angel-palkina/lab04-bonus
angel-palkina Feb 19, 2026
da066b4
docs: add PR screenshot to bonus documentation
angel-palkina Feb 19, 2026
0604ade
Merge pull request #6 from angel-palkina/lab04
angel-palkina Feb 24, 2026
dd807fa
feat: Implemented role-based infrastructure automation with Ansible
angel-palkina Feb 26, 2026
68a1d4b
Merge pull request #7 from angel-palkina/lab05
angel-palkina Mar 5, 2026
8fd4d45
feat: add GitHub Actions CI/CD for Ansible deployment
angel-palkina Mar 5, 2026
9046fc3
docs: complete Lab 06 documentation
angel-palkina Mar 5, 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
86 changes: 86 additions & 0 deletions .github/workflows/ansible-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Ansible Deployment

on:
push:
branches: [ master, lab06 ]
paths:
- 'ansible/**'
- '.github/workflows/ansible-deploy.yml'
pull_request:
branches: [ master, lab06 ]
paths:
- 'ansible/**'
- '.github/workflows/ansible-deploy.yml'
workflow_dispatch: # Позволяет запускать вручную

jobs:
lint:
name: Ansible Lint
runs-on: ubuntu-latest

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

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

- name: Install Ansible and ansible-lint
run: |
pip install ansible ansible-lint

- name: Run ansible-lint
run: |
cd ansible
ansible-lint playbooks/*.yml roles/*/tasks/*.yml || true
continue-on-error: true

deploy:
name: Deploy Application
needs: lint
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'

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

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

- name: Install Ansible and dependencies
run: |
pip install ansible
ansible-galaxy collection install community.docker

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

- name: Test SSH connection
run: |
ssh -i ~/.ssh/id_rsa ${{ secrets.VM_USER }}@${{ secrets.VM_HOST }} "echo 'SSH connection successful'"

- name: Deploy with Ansible
env:
ANSIBLE_HOST_KEY_CHECKING: 'False'
run: |
cd ansible
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > /tmp/vault_pass
ansible-playbook playbooks/deploy.yml \
-i inventory/hosts.ini \
--vault-password-file /tmp/vault_pass
rm /tmp/vault_pass

- name: Verify deployment
run: |
sleep 10
curl -f http://${{ secrets.VM_HOST }}:5000/health || exit 1
echo "✅ Application is healthy!"
86 changes: 86 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
push:
branches:
- master
- lab03
paths:
- 'app_python/**'
- '.github/workflows/python-ci.yml'
pull_request:
branches:
- master
paths:
- 'app_python/**'
- '.github/workflows/python-ci.yml'

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install -r app_python/requirements.txt
pip install -r app_python/requirements-dev.txt

- name: Run linter
run: |
cd app_python
flake8 app.py

- name: Run tests
run: |
cd app_python
pytest -v

- name: Install Snyk CLI
run: |
npm install -g snyk

- name: Authenticate Snyk
run: |
snyk auth ${{ secrets.SYNK_TOKEN }}

- name: Run Snyk security scan
run: |
cd app_python
snyk test --severity-threshold=high




docker:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v4

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

- name: Generate version
run: echo "VERSION=$(date +%Y.%m)" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v6
with:
context: app_python
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/devops-info-service:${{ env.VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/devops-info-service:latest
124 changes: 124 additions & 0 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Terraform CI/CD

on:
push:
branches:
- master
- lab04
paths:
- 'terraform/**'
- '.github/workflows/terraform-ci.yml'
pull_request:
branches:
- master
- lab04
paths:
- 'terraform/**'
- '.github/workflows/terraform-ci.yml'

jobs:
terraform-validation:
name: Terraform Validation
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./terraform

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

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: latest

- name: Terraform Format Check
id: fmt
run: terraform fmt -check -recursive
continue-on-error: true

- name: Terraform Init
id: init
run: terraform init -backend=false

- name: Terraform Validate
id: validate
run: terraform validate -no-color

- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: v0.61.0

- name: Show TFLint version
run: tflint --version

- name: Initialize TFLint
run: tflint --init
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run TFLint
id: tflint
run: tflint --format compact --recursive
continue-on-error: true

- name: Comment PR with Results
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform CI Results 🔍

| Check | Status |
|-------|--------|
| **Terraform Format** | \`${{ steps.fmt.outcome }}\` |
| **Terraform Init** | \`${{ steps.init.outcome }}\` |
| **Terraform Validate** | \`${{ steps.validate.outcome }}\` |
| **TFLint** | \`${{ steps.tflint.outcome }}\` |

<details><summary>📋 Show Details</summary>

#### Terraform Format Check
${{ steps.fmt.outcome == 'success' && '✅ All files are properly formatted' || '❌ Some files need formatting. Run: `terraform fmt -recursive`' }}

#### Terraform Init
${{ steps.init.outcome == 'success' && '✅ Initialization successful' || '❌ Initialization failed' }}

#### Terraform Validate
${{ steps.validate.outcome == 'success' && '✅ Configuration is valid' || '❌ Configuration has syntax errors' }}

#### TFLint
${{ steps.tflint.outcome == 'success' && '✅ No linting issues found' || '⚠️ Linting issues detected (see logs)' }}

</details>

---
*Pusher: @${{ github.actor }} | Workflow: \`${{ github.workflow }}\`*`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
});


- name: Fail workflow if critical validation fails
if: steps.init.outcome == 'failure' || steps.validate.outcome == 'failure'
run: |
echo "❌ Critical validation failed!"
echo "Init status: ${{ steps.init.outcome }}"
echo "Validate status: ${{ steps.validate.outcome }}"
exit 1

- name: Warning if format or lint fails
if: steps.fmt.outcome == 'failure' || steps.tflint.outcome == 'failure'
run: |
echo "⚠️ Non-critical checks failed (format or lint)"
echo "Format status: ${{ steps.fmt.outcome }}"
echo "TFLint status: ${{ steps.tflint.outcome }}"
echo "Please fix these issues, but workflow will not fail."
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
test
test

# Terraform
terraform/.terraform/
terraform/.terraform.lock.hcl
terraform/terraform.tfstate
terraform/terraform.tfstate.backup
terraform/key.json
terraform/*.tfvars

# Pulumi
.pulumi/
venv/
__pycache__/
*.pyc
.env
key.json
Pulumi.*.yaml
!Pulumi.yaml
11 changes: 11 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[defaults]
inventory = inventory/hosts.ini
roles_path = roles
host_key_checking = False
retry_files_enabled = False
remote_user = ubuntu

[privilege_escalation]
become = True
become_method = sudo
become_user = root
Loading