Skip to content

Conversation

@xnoto
Copy link
Contributor

@xnoto xnoto commented Dec 21, 2025

Summary

  • Migrate Ansible project from aap-libvirt-infra to ansible-project-libvirt
  • Rename AAP resources from libvirt-infra to libvirt
  • Use ghcr.io/makeitworkcloud/runner:latest container for CI

Changes

  • Update all repo references to ansible-project-libvirt
  • Rename AAP project, inventory, and credentials to libvirt
  • New GitHub Actions workflows using runner container
  • Update ansible-lint v25.9.0 → 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 files)

- 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
@makeitworkcloud makeitworkcloud deleted a comment from github-actions bot Dec 21, 2025
@makeitworkcloud makeitworkcloud deleted a comment from github-actions bot Dec 21, 2025
@makeitworkcloud makeitworkcloud deleted a comment from github-actions bot Dec 21, 2025
- 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
@makeitworkcloud makeitworkcloud deleted a comment from github-actions bot Dec 21, 2025
@makeitworkcloud makeitworkcloud deleted a comment from github-actions bot Dec 21, 2025
@github-actions
Copy link

Ansible Check (dry-run)


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

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

PLAY [Deploy AAP content] ******************************************************

TASK [Create project] **********************************************************
[WARNING]: You are using the awx version of this collection but connecting to
Red Hat Ansible Automation Platform
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/controller/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 8bb5281 into main Dec 21, 2025
1 check 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
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