refactor: improve Ansible playbooks and enforce linting standards

- refactor playbooks to follow best practices
- implement Ansible Vault for secrets management
- replace direct service restarts with handlers
- add Molecule testing framework with Docker

lint compliance:
- fix all ansible-lint violations (FQCN, booleans, file modes)
- remove duplicate tasks and improve structure
- enforce consistent task ordering and formatting
- add noqa where necessary for edge cases

documentation:
- add REFACTORING.md and VAULT_GUIDE.md
- improve per-role documentation

all playbooks now pass ansible-lint production profile with 0 violations
This commit is contained in:
Mateusz Suski
2026-04-30 06:39:56 +00:00
parent fcf305bd70
commit 2f5e3653d6
+8 -9
View File
@@ -3,26 +3,25 @@ name: ci
on: on:
push: push:
branches: [main] branches: [main]
pull_request:
branches: [main]
jobs: jobs:
validate: validate:
runs-on: ubuntu-latest runs-on: ubuntu
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps
run: |
apt-get update
apt-get install -y python3 python3-pip ansible docker.io
- name: Python syntax check - name: Python syntax check
run: | run: |
python3 -m py_compile \ find migration-validation-framework -name "*.py" -exec python3 -m py_compile {} \;
migration-validation-framework/cli.py \
migration-validation-framework/collectors/*.py \
migration-validation-framework/validators/*.py \
migration-validation-framework/reports/*.py
- name: Ansible syntax check - name: Ansible syntax check
run: | run: |
python3 -m pip install --user ansible
ansible-playbook -i enterprise-infra-simulator/inventory/hosts.ini \ ansible-playbook -i enterprise-infra-simulator/inventory/hosts.ini \
--syntax-check enterprise-infra-simulator/playbooks/*.yml --syntax-check enterprise-infra-simulator/playbooks/*.yml