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:
+9
-10
@@ -3,29 +3,28 @@ 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
|
||||||
|
|
||||||
- name: Docker compose validation
|
- name: Docker compose validation
|
||||||
run: |
|
run: |
|
||||||
docker compose -f observability-stack/docker-compose.yml config
|
docker compose -f observability-stack/docker-compose.yml config
|
||||||
Reference in New Issue
Block a user