Skip to content

Conversation

@xnoto
Copy link
Contributor

@xnoto xnoto commented Dec 22, 2025

Summary

  • Migrate from aap-libvirt-infra to ansible-project-libvirt
  • Add playbooks for configuring runner and torwww VMs
  • AWX project setup automation via .setup_project.yml
  • Refactor from AAP to AWX (remove AAP-specific API patterns)

xnoto added 28 commits December 20, 2025 23:19
- Update repo references to ansible-project-libvirt
- Rename AAP resources from libvirt-infra to libvirt
- Use ghcr.io/makeitworkcloud/runner:latest container
- Update ansible-lint to v25.12.1
- Add community.sops to requirements.yml
- Remove deprecated jinja2_native from ansible.cfg
- Exclude playbooks/ and vars/ from ansible-lint (vault-encrypted)
Alpine 3.21 has Python 3.12, not 3.13
API-based playbook cannot dry-run - dependent variables undefined when tasks skip
- Rewrite setup playbook using awx.awx.project, inventory, host, credential, job_template
- Move to .setup_project.yml (hidden from AAP playbook discovery)
- Restore --check --diff in CI workflow
- Add awx.awx to requirements.yml
- Use CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX for AAP compatibility
- Pre-commit job runs basic hooks (skips ansible-lint)
- Ansible-check job installs collections, runs ansible-lint, runs --check --diff
- Enable ansible-lint for playbooks/ directory
- Add Makefile targets: lint, check, commit (all set ANSIBLE_VAULT_PASSWORD_FILE)
- Add .envrc for direnv users
- Merge pre-commit and ansible-check into single job
- Capture ansible-playbook --check --diff output
- Truncate to 1000 lines for safety
- Post as PR comment using github-script
- Project sync fails in check mode when project doesn't exist yet
- Disable scm_update_on_launch since CI handles sync
- Add ANSIBLE_INVENTORY_UNPARSED_WARNING to suppress 'No inventory was parsed' warning
- Use continue-on-error pattern in check workflow to capture output before failing
- Add apply target to Makefile
- Remove AAP-specific CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX
- Rename aap_* variables to awx_*
- Update comments and play names
@github-actions
Copy link

Ansible Check (dry-run)


PLAY [Load SOPS secrets] *******************************************************

TASK [Load SOPS secrets] *******************************************************
ok: [localhost]

PLAY [Deploy AWX content] ******************************************************

TASK [Create project] **********************************************************
changed: [localhost]

TASK [Sync project] ************************************************************
skipping: [localhost]

TASK [Create inventory] ********************************************************
changed: [localhost]

TASK [Add libvirt host to inventory] *******************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Request to /api/v2/inventories/?name=libvirt returned 0 items, expected 1", "query": {"name": "libvirt"}, "response": {"json": {"count": 0, "next": null, "previous": null, "results": []}, "status_code": 200}, "total_results": 0}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=2    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   

@xnoto xnoto merged commit 516c8c8 into main Dec 22, 2025
2 checks passed
xnoto added a commit that referenced this pull request Dec 28, 2025
* feat: migrate from aap-libvirt-infra

- Update repo references to ansible-project-libvirt
- Rename AAP resources from libvirt-infra to libvirt
- Use ghcr.io/makeitworkcloud/runner:latest container
- Update ansible-lint to v25.12.1
- Add community.sops to requirements.yml
- Remove deprecated jinja2_native from ansible.cfg
- Exclude playbooks/ and vars/ from ansible-lint (vault-encrypted)

* fix: use system python for ansible-lint pre-commit hook

Alpine 3.21 has Python 3.12, not 3.13

* fix: remove ansible-playbook --check from CI

API-based playbook cannot dry-run - dependent variables undefined when tasks skip

* refactor: replace URI calls with awx.awx collection modules

- Rewrite setup playbook using awx.awx.project, inventory, host, credential, job_template
- Move to .setup_project.yml (hidden from AAP playbook discovery)
- Restore --check --diff in CI workflow
- Add awx.awx to requirements.yml
- Use CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX for AAP compatibility

* fix: split plays so secrets load before module_defaults evaluation

* refactor: split CI into pre-commit and ansible-check jobs

- Pre-commit job runs basic hooks (skips ansible-lint)
- Ansible-check job installs collections, runs ansible-lint, runs --check --diff
- Enable ansible-lint for playbooks/ directory
- Add Makefile targets: lint, check, commit (all set ANSIBLE_VAULT_PASSWORD_FILE)
- Add .envrc for direnv users

* fix: run ansible-lint via pre-commit in CI for consistency

* refactor: single CI job with PR comment for ansible check output

- Merge pre-commit and ansible-check into single job
- Capture ansible-playbook --check --diff output
- Truncate to 1000 lines for safety
- Post as PR comment using github-script

* fix: skip project sync in check mode, disable scm_update_on_launch

- Project sync fails in check mode when project doesn't exist yet
- Disable scm_update_on_launch since CI handles sync

* fix: suppress localhost inventory warning in CI and Makefile

* refactor: update PR comments instead of creating new ones

* fix: suppress inventory warnings and improve CI failure handling

- Add ANSIBLE_INVENTORY_UNPARSED_WARNING to suppress 'No inventory was parsed' warning
- Use continue-on-error pattern in check workflow to capture output before failing
- Add apply target to Makefile

* fix: embed HTML marker in comment body for find-comment to work

* test: verify PR comment update

* fix: skip prepare-comment step for non-PR events

* refactor: delete and recreate PR comment for fresh timestamp

* refactor: use johanwulf/replace-comment action

* fix: use full version tag v1.0.0 for replace-comment

* refactor: migrate from AAP to AWX

- Remove AAP-specific CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX
- Rename aap_* variables to awx_*
- Update comments and play names

* chore: align pre-commit config and fix trailing newlines

* fix: downgrade pre-commit-hooks to v5.0.0 for Python 3.12 compat

* fix: add setup-python for Python 3.13, restore pre-commit-hooks v6.0.0

* fix: install python3.13 via dnf in container

* fix: use setup-python and pip install pre-commit

* fix: use --break-system-packages for pip install

* refactor: split lint and check jobs, use pre-commit/action

* fix: exclude playbooks from ansible-lint (vault-encrypted vars)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants