# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-netbox-network-importer VERSION= 1.1.4 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= Tool to import network into Netbox (3.12) SDESC[v13]= Tool to import network into Netbox (3.13) HOMEPAGE= https://gitlab.cesnet.cz/701/done/netbox_network_importer CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPI/n/netbox-network-importer DISTFILE[1]= netbox_network_importer-1.1.4.tar.gz:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= netbox_network_importer-1.1.4 GENERATED= yes [PY312].BUILDRUN_DEPENDS_ON= python-click:single:v12 python-pynetbox:single:v12 python-python-slugify:single:v12 python-appdirs:single:v12 python-PyYAML:single:v12 python-python-dotenv:single:v12 python-netutils:single:v12 python-nornir:single:v12 python-nornir-netbox:single:v12 python-nornir-utils:single:v12 python-nornir-rich:single:v12 python-deepdiff:single:v12 python-napalm:single:v12 python-ncclient:single:v12 python-loguru:single:v12 python-dictdiffer:single:v12 python-json2html:single:v12 python-jsonpickle:single:v12 python-pytest-runner:single:v12 [PY312].USES_ON= python:v12,sutools [PY313].BUILDRUN_DEPENDS_ON= python-click:single:v13 python-pynetbox:single:v13 python-python-slugify:single:v13 python-appdirs:single:v13 python-PyYAML:single:v13 python-python-dotenv:single:v13 python-netutils:single:v13 python-nornir:single:v13 python-nornir-netbox:single:v13 python-nornir-utils:single:v13 python-nornir-rich:single:v13 python-deepdiff:single:v13 python-napalm:single:v13 python-ncclient:single:v13 python-loguru:single:v13 python-dictdiffer:single:v13 python-json2html:single:v13 python-jsonpickle:single:v13 python-pytest-runner:single:v13 [PY313].USES_ON= python:v13,sutools [FILE:2892:descriptions/desc.single] # Netbox Network Importer Tool to analyze and synchronize an existing network with a Netbox (SOT). The main use cases for the network importer: - Import an existing network into a Netbox - ~~Check the differences between the running network and the Netbox~~ --- ## Install 1. Clone repository - `git clone git@gitlab.cesnet.cz:701/done/netbox_network_importer.git` 2. Go into the repository - `cd netbox_network_importer ` 3. Create `virtualenv` - `python3 -m venv venv` 3. Activate it - `source venv/bin/activate` 3. Install the tool - `pip install .` --- ## Pre-requisite To operate, the Netbox Network Importer is dependent on the following items: - Access to Netbox API - Access to Network Devices via SSH - Created Custom Field on Netbox ```json { "display": "Ignore Importer", "content_types": [ "dcim.interface", ], "type": { "value": "boolean", "label": "Boolean (true/false)" }, "object_type": null, "data_type": "boolean", "name": "ignore_importer", "label": "Ignore Importer", "description": "Will be ignored when processed by Network Importer", "required": true, "filter_logic": { "value": "exact", "label": "Exact" }, "default": false, "weight": 100, } ``` --- ## Inventory A device inventory must be available in NetBox. To be able to connect to the device the following information needs to be defined : - Primary ip address - Platform (must be a one of the following ['iosxr', 'ios', 'iosxe']) --- ## Configuration file The information to connect to NetBox must be provided via the configuration file. The configuration file below present standard options that can be provided to control the behavior of the Netbox Network Importer. Netbox Network Importer try to find the configuration file at: - `/home//.config/netbox_network_importer/config.yml` - `/etc/netbox_network_importer/config.yml` - Or you can set path to configuratin file like: - `netbox_network_importer --config path_to_dir_with_config/ synchronize` ``` --- netbox: NETBOX_API_TOKEN: "API_TOKEN" NETBOX_INSTANCE_URL: "https://netbox.done-test.cesnet.cz/" NETBOX_GRAPHQL_URL: "https://netbox.done-test.cesnet.cz/graphql/" tacacs: TACACS_USERNAME: "username" TACACS_PASSWORD: "password" config: LOG_DIR: "path_where_output.log_will_be_stored" LOG_LEVEL: "DEBUG" OUTPUT_DIR: "output_folder_where_results_will_be_stored" ``` --- ## Execute The Netbox Network Importer runs only in apply mode. - ~~In check mode, no modification will be made to the SOT, the differences will be printed on the screen~~ - In apply mode, the NETBOX will be updated with: - interfaces - IPs - vlans - LAGs ### Apply Mode The Netbox Network Importer will attempt to create/update or delete all elements in the Netbox that do not match what has been observed in the [FILE:126:distinfo] 7bc3ca23b2ec7325c8bf83e0ee145927a2fbc4e1de8ea79bfbe5b4edcd8f9515 25719 python-src/netbox_network_importer-1.1.4.tar.gz