Resolve collections vars from provision_unit, not bare play vars #9

Merged
sysadmin merged 1 commit from fix/collections-vars-from-provision-unit into main 2026-10-06 17:08:14 +00:00
Contributor

Companion to PR #7/#8: playbook_ansible_collections_url_prefix/default_version were undef()-hinted play vars on hosts: localhost, a different scope from the per-host provision_unit dict (where the root metadata.yml merge from PR #8 actually lands). A value set only in the root metadata.yml never reached Play 2.

Now pulled from the first provision_tech_targets host's own provision_unit, computed only when at least one role actually needs the git-derived path. -e still overrides.

Verified live against the real infrastructure/homelab repo with its new root metadata.yml: both vars land correctly in the rendered host_vars.

🤖 Generated with Claude Code

https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp

Companion to PR #7/#8: playbook_ansible_collections_url_prefix/default_version were undef()-hinted play vars on hosts: localhost, a different scope from the per-host provision_unit dict (where the root metadata.yml merge from PR #8 actually lands). A value set only in the root metadata.yml never reached Play 2. Now pulled from the first provision_tech_targets host's own provision_unit, computed only when at least one role actually needs the git-derived path. `-e` still overrides. Verified live against the real infrastructure/homelab repo with its new root metadata.yml: both vars land correctly in the rendered host_vars. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
Resolve collections vars from provision_unit, not bare play vars
All checks were successful
Ansible Lint / ansible-lint (pull_request) Successful in 1m10s
efbda2961c
playbook_ansible_collections_url_prefix/default_version were undef()-
hinted play vars on hosts: localhost -- a different scope from the
per-host provision_unit dict every provisioned host carries, which is
where env_parser's root-metadata.yml merge (PR #8) actually lands. A
value set only in the env_source's root metadata.yml never reached
Play 2 at all under the old wiring.

Now pulled from the first provision_tech_targets host's own
provision_unit, computed only when at least one role actually needs the
git-derived path (so a run that never needs them doesn't pay their
undef(hint=...) fail-fast cost either). -e still overrides, same as
before -- Ansible's own extra-vars precedence is unconditional.

Verified live against the real infrastructure/homelab repo with its new
root metadata.yml: both vars land correctly in the rendered host_vars.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ansible-collections/silvarion.provision!9
No description provided.