--- # Orchestrator: use NetBox inventory, determine cloud provider per-host, and run update-netbox-fatcs role - name: Update NetBox inventory (orchestrator) hosts: all gather_facts: false vars: ansible_python_interpreter: /usr/bin/python3.11 vars_files: - roles/update-netbox-fatcs/vars/main.yml tasks: - name: Run lookforvm role to detect if host exists in vCenter or Azure include_role: name: lookforvm vars: ansible_connection: local - name: Set vmware_datacenter based on lookforvm results set_fact: vmware_datacenter: >- {% if vm_found_azure | default(false) %}azure{% elif vm_found_vcenter | default(false) %}onprem{% else %}onprem{% endif %} - name: Run update-netbox-fatcs role to collect facts and update NetBox include_role: name: update-netbox-fatcs # vmware_datacenter is set above via set_fact; do not re-pass a self-referential # template here (it caused recursive templating). The role will inherit the var.