costum lookup plugin test
This commit is contained in:
3
ansible.cfg
Normal file
3
ansible.cfg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[defaults]
|
||||||
|
|
||||||
|
inventory_plugins = ./plugins/inventory
|
||||||
@ -1,7 +1 @@
|
|||||||
plugin: netbox.netbox.nb_inventory
|
plugin: td_assetmgmt
|
||||||
api_endpoint: https://demo.netbox.dev
|
|
||||||
token: da482f8ca0d65ebc3b97aba4a2b5cc66e31f8a7f
|
|
||||||
plurals: no
|
|
||||||
group_by:
|
|
||||||
- device_type
|
|
||||||
|
|
||||||
|
|||||||
11
plugins/inventory/td_assetmgmt.py
Normal file
11
plugins/inventory/td_assetmgmt.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from ansible.plugins.inventory import BaseFileInventoryPlugin
|
||||||
|
|
||||||
|
class InventoryModule(BaseFileInventoryPlugin):
|
||||||
|
|
||||||
|
NAME = 'td_assetmgmt'
|
||||||
|
|
||||||
|
def parse(self, inventory, loader, path, cache=True):
|
||||||
|
|
||||||
|
super(InventoryModule, self).parse(inventory, loader, path, cache)
|
||||||
|
|
||||||
|
self.inventory.add_host('boi')
|
||||||
Reference in New Issue
Block a user