|
1 | 1 | # Configuration File
|
2 | 2 |
|
3 |
| -By default the network importer will try to load a configuration file name `network_importer.toml`, this configuration file is not mandatory as long as the required information to connect to NetBox, Batfish and/or the network devices are provided via environment variables. |
| 3 | +By default the network importer will try to load a configuration file name `network_importer.toml`, this configuration file is not mandatory as long as the required information to connect to the SOT, Batfish and/or the network devices are provided via environment variables. |
4 | 4 |
|
5 | 5 | It's possible to specify which configuration file should be used in cli with the option `--config`.
|
6 | 6 |
|
7 |
| -The configuration file is organized in 8 sections detailed below. |
| 7 | +The configuration file is organized in 7 sections detailed below. |
8 | 8 |
|
9 | 9 | ## Main Section
|
10 | 10 |
|
@@ -32,39 +32,35 @@ import_vlans = "config" # Valid options are ["cli", "config", "no", true
|
32 | 32 | import_cabling = "lldp" # Valid options are ["lldp", "cdp", "config", "no", true, false]
|
33 | 33 | excluded_platforms_cabling = ["cisco_asa"]
|
34 | 34 |
|
35 |
| -# Number of Nornir tasks to execute at the same tim |
36 |
| -nbr_workers= 25 |
| 35 | +# Number of Nornir tasks to execute at the same time |
| 36 | +nbr_workers = 25 |
37 | 37 |
|
38 | 38 | # Directory where the configuration can be find, organized in Batfish format
|
39 | 39 | configs_directory = "configs"
|
| 40 | + |
| 41 | +# Valid Backend |
| 42 | +# Only Netbox and Nautobot backend are included by default, if you want to use another backend |
| 43 | +# you must leave backend empty and define inventory.inventory_class and adapters.sot_class manually. |
| 44 | +backend = "nautobot" |
40 | 45 | ```
|
41 | 46 |
|
42 |
| -# NetBox Section |
| 47 | +# Inventory Section |
43 | 48 |
|
44 |
| -The `[netbox]` section regroup all parameters to connect to NetBox and it also include an optional list of supported platforms. |
| 49 | +The `[inventory]` section regroup all parameters related to the inventory and also includes an optional list of supported platforms. network-importer supports multiple inventories, you can define your own inventory by defining `inventory_class` and each inventory can define its own list of settings which will need to be configurated under `[inventory.settings]`. The settings for the [nautobot inventory](backend/nautobot.md) and for the [netbox inventory](backend/netbox.md) are available in their respective documentation. |
45 | 50 |
|
46 | 51 | ```toml
|
47 |
| -[netbox] |
48 |
| -address = "http://localhost:8080" # Alternative Env Variable : NETBOX_ADDRESS |
49 |
| -token = "113954578a441fbe487e359805cd2cb6e9c7d317" # Alternative Env Variable : NETBOX_TOKEN |
50 |
| -verify_ssl = true # Alternative Env Variable : NETBOX_VERIFY_SSL |
| 52 | +[inventory] |
51 | 53 |
|
52 | 54 | # Define a list of supported platform,
|
53 | 55 | # if defined all devices without platform or with a different platforms will be removed from the inventory
|
54 | 56 | supported_platforms = [ "cisco_ios", "cisco_nxos" ]
|
55 | 57 |
|
56 |
| -# Settings for applying diffsync flags to diffsync model objects, in order to alter |
57 |
| -# the underlying sync behaviour. The model_flag is applied to any objects that have a |
58 |
| -# tag assigned within model_flag_tags. Further details on model_flags can be found |
59 |
| -# at: https://github.com/networktocode/diffsync/blob/269df51ce248beaef17d72374e96d19e6df95a13/diffsync/enum.py |
60 |
| -model_flag_tags = ["your_tag"] |
61 |
| -model_flag = 1 # flag enum int() representation |
62 |
| -``` |
63 |
| - |
64 |
| - |
65 |
| - model_flag_tags: List[str] = list() # List of tags that defines what objects to assign the model_flag to. |
66 |
| - model_flag: Optional[DiffSyncModelFlags] # The model flag that will be applied to objects based on tag. |
| 58 | +# Configure which Inventory will be loaded by the network importer. |
| 59 | +inventory_class = "network_importer.inventory.NetboxInventory" |
67 | 60 |
|
| 61 | +[inventory.settings] |
| 62 | +# Inventory specific settings, please refer to the documentation of each backend/inventory. |
| 63 | +``` |
68 | 64 |
|
69 | 65 | ## Batfish Section
|
70 | 66 |
|
@@ -93,43 +89,40 @@ login = "username" # Alternative Env Variable : NETWORK_DEVICE_LOGIN
|
93 | 89 | password = "password" # Alternative Env Variable : NETWORK_DEVICE_PWD
|
94 | 90 | enable = true # Alternative Env Variable : NETWORK_DEVICE_ENABLE
|
95 | 91 |
|
96 |
| -# Connection parameters for Netmiko |
97 |
| -global_delay_factor = 5 |
98 |
| -banner_timeout = 15 |
99 |
| -conn_timeout = 5 |
100 |
| - |
101 | 92 | # List of valid FQDN that can be found in the network,
|
102 | 93 | # The FQDNs in this list will be automatically removed from all neighbors discovered from LLDP/CDP
|
103 | 94 | fqdns = [ ]
|
104 |
| -``` |
105 |
| - |
106 |
| -## Inventory Section |
107 | 95 |
|
108 |
| -Define what method should be used to connect to the network devices. |
| 96 | +[network.netmiko_extras] |
| 97 | +# Any additional parameters for Netmiko defined in this section will be automatically configured |
| 98 | +# as part of the Nornir inventory. |
109 | 99 |
|
110 |
| -```toml |
111 |
| -[inventory] |
112 |
| -# The default method is to use the primary IP defined in NetBox. |
113 |
| -# As an alternative it's possible to use the name of the device and provide your own FQDN. |
114 |
| -use_primary_ip = false (default: true) |
115 |
| -fqdn = "mydomain.com" |
116 |
| - |
117 |
| -# Optional filter to limit the scope of the inventory, takes a comma separated string of key value pair" |
118 |
| -filter = "site=XXX,site=YYY,status=active" # Alternative Env Variable : INVENTORY_FILTER |
119 |
| - |
120 |
| -# Configure what Inventory will be loaded bu the network importer. |
121 |
| -inventory_class = "network_importer.inventory.NetboxInventory" |
| 100 | +[network.napalm_extras] |
| 101 | +# Any additional parameters for Napalm defined in this section will be automatically configured |
| 102 | +# as part of the Nornir inventory. |
122 | 103 | ```
|
123 | 104 |
|
124 | 105 | ## Adapters Section
|
125 | 106 |
|
126 | 107 | Configure which adapters will be loaded by the network importer.
|
127 | 108 | Please see the [extensibility section](extensibility.md) of the documentation for more details on how to create your own adapter.
|
| 109 | +The settings for the [nautobot adapter](backend/nautobot.md) and for the [netbox adapter](backend/netbox.md) are available in their respective documentation. |
128 | 110 |
|
129 | 111 | ```toml
|
130 | 112 | [adapters]
|
131 | 113 | network_class = "network_importer.adapters.network_importer.adapter.NetworkImporterAdapter"
|
| 114 | + |
| 115 | + |
132 | 116 | sot_class = "network_importer.adapters.netbox_api.adapter.NetBoxAPIAdapter"
|
| 117 | + |
| 118 | +[adapters.network_settings] |
| 119 | +# Network Adapter specific settings, any settings defined in this section will be passed to the Network Adapter. |
| 120 | +# The default network adapter doesn't accept additional settings, nonetheless this section remains available if you want to |
| 121 | +# customize the default Network Adapter |
| 122 | + |
| 123 | +[adapters.sot_settings] |
| 124 | +# SOT Adapter specific settings, any settings defined in this section will be passed to the SOT Adapter. |
| 125 | +# Please refer to the documentation of each adapter to see what settings are required/supported. |
133 | 126 | ```
|
134 | 127 |
|
135 | 128 | ## Drivers Section
|
|
0 commit comments