From 0ab18152414af7fda519b823091554cde942892e Mon Sep 17 00:00:00 2001 From: "D. Arnodo" <124083497+darnodo@users.noreply.github.com> Date: Sun, 30 Mar 2025 19:30:25 +0200 Subject: [PATCH] fix(fabric): add leaf number variable (#11) --- documentation/CookBook.md | 18 ++++++++++++++++-- utilities/Create_Fabric/fabric_creator.py | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/documentation/CookBook.md b/documentation/CookBook.md index 04d0db9..d7bb790 100644 --- a/documentation/CookBook.md +++ b/documentation/CookBook.md @@ -9,10 +9,24 @@ ### Popule data in Netbox -Generate a Netbox token via webui and execute the python script +Generate a Netbox token via webui and execute the python script, and on utilities folder start population : ```bash -python import.py http://localhost:8080 YOUR_NETBOX_TOKEN device_model.yml subnets.yml +uv run import.py http://localhost:8080 YOUR_TOKEN Devices/devices_model.yml ``` ## Create Fabric + +```bash +uv run Create_Fabric/main.py +NetBox URL: http://localhost:8080 +NetBox API Token: +Number of buildings (1-5): 4 +Spine device type slug: ceos +Leaf device type slug: ceos +Access switch device type slug: ceos + +Existing Sites: + 1. Paris (slug=paris) +Choose site number or 'new': 1 +``` diff --git a/utilities/Create_Fabric/fabric_creator.py b/utilities/Create_Fabric/fabric_creator.py index 78d4c0c..8133d52 100644 --- a/utilities/Create_Fabric/fabric_creator.py +++ b/utilities/Create_Fabric/fabric_creator.py @@ -152,7 +152,7 @@ class VXLANFabricCreator: ) # Création Leaf - leaf_name = f"{self.config.site_code.lower()}{str(building_num).zfill(2)}_lf1_00" + leaf_name = f"{self.config.site_code.lower()}{str(building_num).zfill(2)}_lf{str(building_num).zfill(1)}_00" leaf = self.nb.create_device( name=leaf_name, device_type_slug=self.config.leaf_type,