Replies: 2 comments
-
The inventory plugin supports two options:
Consult the documentation for their usage, but in general the inventory plugin depends on If you are relying on DNS instead of NetBox to manage the IP address that is used to access a device, you may not want to use the inventory plugin, and instead use the query plugin. I have not used the inventory plugin extensively and have more experience using the query plugin, so I could be mistaken, but this is based on reading the code over coffee. |
Beta Was this translation helpful? Give feedback.
-
Today testet:
|
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm using
nb_inventory
as our dynamic inventory source.It looks like ansible is trying to use
primary_ip
from netbox when reaching the host, instead of using DNS name and get IP from our DNS server.We changed the name of one of our hosts recently, let's say from server1 to server2. It had interface
eth0
with assigned address10.9.61.82/24
set as aprimary_ip.
nslookup was resolving a different address that is
192.168.249.67/24,
and it is correct according to our DNS server.I was able to reach this host on its correct address with Ansible, after I've removed the
primary_ip
from Netbox.I was trying to play with various parameters, but nothing helped. How to avoid situation like that? Is this normal behaviour or some misconfiguration on our side?
Beta Was this translation helpful? Give feedback.
All reactions