fix: validation to work with inventory in different directory than playbook#679
fix: validation to work with inventory in different directory than playbook#679lumean wants to merge 1 commit intonetascode:developfrom
Conversation
Peer Review: PR #679 — Fix validation with separate inventory directory
Bug SummaryWhen the Ansible inventory directory is in a different path than the playbook directory, the Error message: FixFile: # Before:
data_path: "{{ playbook_dir }}/host_vars/{{ inventory_hostname }}"
# After:
data_path: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}"No other production code paths use Reproduction SetupIsolated directory separating playbook from inventory: Path resolution:
Command pattern: ansible-playbook bug678_case/vxlan.yaml \
-i bug678_case/fab1_inventory/inventory.yaml \
--limit <FABRIC> --tags <role_tag>Test ResultsPhase 1: Baseline without fix (collection @ develop)
This confirms the bug is reproducible. The Phase 2: Single-fabric validation with fix (collection @ pr-679)
Phase 3: Multi-fabric validation with fix (collection @ pr-679)Deploy order:
Additional Validation Notes
Conclusion
Environment
|
Related Issue(s)
Fixes #678
Related Collection Role
Related Data Model Element
Proposed Changes
Make the data folder lookup relative to the
inventory_dirrather than theplaybook_dir.This enables using the same playbook with multiple inventories / fabrics (e.g. when using with vxlan multi-site we have at least 3 inventories - site1, site2 and msite)
Test Notes
Cisco Nexus Dashboard Version
Tested against ND 4.1.1g
Checklist