netbox inventory fails with message: object has no attribute '_vars'

173 views
Skip to first unread message

heinz6...@gmail.com

unread,
Nov 7, 2022, 11:47:32 AM11/7/22
to Ansible Project
Hi.,

I have a new setup of netbox on ubuntu.
- netbox install according to setup
- apt install ansible pynetbox

ansible.cfg:
[inventory]
enable_plugins = host_list, auto, yaml, netbox.netbox.nb_inventory

netbox_inventory.yaml:
plugin: netbox.netbox.nb_inventory
api_endpoint: https://localhost
token:  12345

ansible-inventory -vvv -llist -i netbox_inventory.yaml
fails with the error message:
[WARNING]:  * Failed to parse /root/netbox_inventory.yaml with ansible_collections.netbox.netbox.plugins.inventory.nb_inventory plugin: 'InventoryModule' object has
no attribute '_vars'
 File "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 289, in parse_source
   plugin.parse(self._inventory, self._loader, source, cache=cache)
 File "/root/.ansible/collections/ansible_collections/netbox/netbox/plugins/inventory/nb_inventory.py", line 1953, in parse
   self.templar.available_variables = self._vars
[WARNING]: Unable to parse /root/netbox_inventory.yaml as an inventory source

Any ideas?

Michael
Reply all
Reply to author
Forward
0 new messages