Open dschemp opened 10 months ago
For clarification: we have virtual machines with different interfaces, one of which being a management interface over which we can use Ansible. This does not have to be the primary IP for the VM. For reasons I cannot explain we are unable to set the management interface / IP as the primary IP.
Ansible NetBox Collection version
v3.16.0
Ansible version
NetBox version
v3.6.6
Python version
3.10
Steps to Reproduce
1.1.1.1/28
and99.99.99.99/32
)management
netbox_inventory.yml
with the following configuration:interfaces: true compose: ansible_host: ((interfaces | selectattr('tags', 'contains', 'management') | list)[0].ip_addresses[0].address) | split('/') | first strict: true
@all: |--@ungrouped: | |--grafana01 | | |--{ansible_host = 99.99.99.99} | | |--{interfaces = [...]} | | |--[...]
[WARNING]: Failed to parse /home/dschemp/Projects/ansible-netbox/netbox_inventory.yml with auto plugin: Could not set ansible_host for host grafana01: 'interfaces' is undefined. 'interfaces' is undefined [WARNING]: Failed to parse /home/dschemp/Projects/ansible-netbox/netbox_inventory.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory [WARNING]: * Failed to parse /home/dschemp/Projects/ansible-netbox/netbox_inventory.yml with ini plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a YAML file. [WARNING]: Unable to parse /home/dschemp/Projects/ansible-netbox/netbox_inventory.yml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available @all: |--@ungrouped: