chore(ci): add CI workflow and Dependabot hardening - #81
Conversation
- CI runs inside containerised Debian/Python/Node images (not bare ubuntu-latest) - Dependabot enabled for package ecosystem + github-actions
dev branch has no pyproject.toml (Python package lives on feat/r42playbooks-generator). The previous single job failed with "does not appear to be a Python project". Now: - ansible-lint always runs on bundles/ - ruff+pytest only run when pyproject.toml exists (hashFiles guard)
Job-level hashFiles() evaluates before checkout so the workspace is always empty; replace with a step-level shell test writing to GITHUB_OUTPUT. Also drop --profile=production (incompatible with org conventions) and add .ansible-lint config with profile:basic.
…epo stubs ansible-lint 6.x rejects syntax-check in skip_list; stub the catalog and proxmox-controller roles with mock_roles so syntax-check passes without cross-repo checkouts.
…] + stub global_vm_ssh_name
Role lives in range42-catalog which is not checked out in CI; stub it so ansible-lint syntax-check passes.
da13c06 to
90d37d8
Compare
Review — approve with commentsCI workflow, Blocking
Non-blocking
Cross-repo
Verification
Generated by Claude Code |
Behavior-preserving: null vars: becomes vars: {}, when: moves above
block: (key-order), empty play name: keys removed, vars_files
indentation normalized. Verified: ansible-lint bundles/ exits 0 on
profile basic (0 failures, 21 warnings) with ansible-lint 26.6.0.
- pin ansible-lint==26.6.0 so a lint release cannot turn the gate red without a repo change - drop ruff --select ALL (not recommended upstream) in favor of an E9,F baseline defined in .ruff.toml, same as the range42 repo - note on mock_roles that the list is hand-maintained and belongs on the catalog role-rename checklist - ignore .ansible/ (ansible-lint mock-role cache)
|
@pparage comments addressed — pushed Pins: ruff: mock_roles: now carries a maintenance note (hand-maintained; add new catalog roles here; belongs on the catalog rename checklist). Verification — you flagged you couldn't run the lint, and that caution was justified: |
# Conflicts: # .gitignore # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_00/deployer_api_gateway.yml # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_00/deployer_ui.yml # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_00/mon_wazuh.yml # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_01/_r42_admin.yml # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_01/deployer_ui.yml # bundles/core/proxmox/configure/default/vms/create-vms-admin/stage_01/mon_wazuh.yml # bundles/core/proxmox/configure/default/vms/create-vms-student/stage_01/_r42_student_box_group.yml # bundles/core/proxmox/configure/default/vms/create-vms-vuln/stage_00/vuln_box_00.yml # bundles/core/proxmox/configure/default/vms/create-vms-vuln/stage_01/_r42_vuln_box_group.yml # scenarios/blank_scenario_2_subnets/03_team_infrastructure/stage_00-vm_bootstrap/bs2_team_143_01.yml # scenarios/blank_scenario_2_subnets/03_team_infrastructure/stage_00-vm_bootstrap/bs2_team_143_02.yml # scenarios/blank_scenario_2_subnets/03_team_infrastructure/stage_00-vm_bootstrap/bs2_team_144_01.yml # scenarios/blank_scenario_2_subnets/03_team_infrastructure/stage_00-vm_bootstrap/bs2_team_144_02.yml
…nt --fix Style-only: colon/comma spacing, quote style, key-order (when above block), long-line folds. dev's new bundle trees (admin_services_lab, generic baselines, ctf CVEs) had never been linted.
- extra_vars: target_group/TARGET_GROUP/wazuh_clients_group and the kunai wrapper group vars are inventory-provided at runtime - mock_roles: five new catalog roles referenced by bundles/generic - RANGE42_BUNDLE_DIR env on the lint step — the kunai_workshop wrapper resolves its inner import_playbook path from it Verified: ansible-lint bundles/ exits 0 (0 failures, 1 warning) with ansible-lint 26.6.0 on the dev-merged tree.
|
Conflict with
|
bundles/admin uses ansible.posix.synchronize, which is not bundled with ansible-core on the CI image — syntax-check[unknown-module] was CI-only because local ~/.ansible/collections masked it.
Summary
Closes #80
Changes
.github/workflows/ci.yml— CI pipeline running in a containerised Debian/Python/Node image.github/dependabot.yml— automated dependency updatesTest plan