From 9e1a90833d984ff19aa39d5a9e862f1e2da5d46e Mon Sep 17 00:00:00 2001 From: TheNetworkGuy Date: Sun, 8 Jun 2025 21:45:45 +0200 Subject: [PATCH] Added new config parameters to base template --- modules/config.py | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/modules/config.py b/modules/config.py index 6528d67..586227d 100644 --- a/modules/config.py +++ b/modules/config.py @@ -1,5 +1,5 @@ """ -Module for parsing configuration from the top level config.yaml file +Module for parsing configuration from the top level config.py file """ from pathlib import Path from importlib import util @@ -8,7 +8,8 @@ from logging import getLogger logger = getLogger(__name__) -# PLEASE NOTE: This is a sample config file. You should create your own config.py +# PLEASE NOTE: This is a sample config file. Please do NOT make any edits in this file! +# You should create your own config.py and it will overwrite the default config. DEFAULT_CONFIG = { "templates_config_context": False, @@ -30,7 +31,7 @@ DEFAULT_CONFIG = { "nb_vm_filter": {"name__n": "null"}, "inventory_mode": "disabled", "inventory_sync": False, - "inventory_map": { + "device_inventory_map": { "asset_tag": "asset_tag", "virtual_chassis/name": "chassis", "status/label": "deployment_status", @@ -44,6 +45,38 @@ DEFAULT_CONFIG = { "device_type/model": "type", "device_type/manufacturer/name": "vendor", "oob_ip/address": "oob_ip" + }, + "vm_inventory_map": { + "status/label": "deployment_status", + "comments": "notes", + "name": "name" + }, + "usermacro_sync": False, + "device_usermacro_map": { + "serial": "{$HW_SERIAL}", + "role/name": "{$DEV_ROLE}", + "url": "{$NB_URL}", + "id": "{$NB_ID}" + }, + "vm_usermacro_map": { + "memory": "{$TOTAL_MEMORY}", + "role/name": "{$DEV_ROLE}", + "url": "{$NB_URL}", + "id": "{$NB_ID}" + }, + "tag_sync": False, + "tag_lower": True, + "tag_name": 'NetBox', + "tag_value": "name", + "device_tag_map": { + "site/name": "site", + "rack/name": "rack", + "platform/name": "target" + }, + "vm_tag_map": { + "site/name": "site", + "cluster/name": "cluster", + "platform/name": "target" } }