Installing the App in Nautobot¶
Prerequisites¶
- The app is compatible with Nautobot 3.1.0 and higher.
- Databases supported: PostgreSQL, MySQL
Note
Please check the dedicated page for a full compatibility matrix and the deprecation policy.
Access Requirements¶
N/A
Install Guide¶
Note
Apps can be installed from the Python Package Index or locally. See the Nautobot documentation for more details. The pip package name for this app is nautobot-plugin-nornir.
The app is available as a Python package via PyPI and can be installed with pip:
To ensure Nautobot Plugin Nornir is automatically re-installed during future upgrades, create a file named local_requirements.txt (if not already existing) in the Nautobot root directory (alongside requirements.txt) and list the nautobot-plugin-nornir package:
Once installed, the app needs to be enabled in your Nautobot configuration. Append "nautobot_plugin_nornir" to the PLUGINS list in your nautobot_config.py file:
The app ships working defaults, so a "nautobot_plugin_nornir" entry in PLUGINS_CONFIG is optional. Add the entry only to override a default. The block below shows the settings that most deployments change:
# In your nautobot_config.py
PLUGINS_CONFIG = {
"nautobot_plugin_nornir": {
"use_config_context": {"secrets": False, "connection_options": True},
# Optionally set global connection options.
"connection_options": {
"napalm": {
"extras": {
"optional_args": {"global_delay_factor": 1},
},
},
"netmiko": {
"extras": {
"global_delay_factor": 1,
},
},
},
}
}
Note
You may set only the nornir_settings keys you want to change. The app merges your keys over the defaults, so a dictionary that sets only credentials keeps the default inventory and runner. The merge is one level deep: if you set runner, supply the whole runner dictionary. Note that the Nautobot admin Configuration page shows only the keys you set, while the app uses the merged values.
App Configuration¶
The plugin behavior can be controlled with the following list of settings.
| Key | Example | Default | Description |
|---|---|---|---|
| nornir_settings | The expected configuration paramters that Nornir uses, see Nornir documentation. | ||
| username | ntc | N/A | The username when leveraging the CredentialsSettingsVars credential provider. |
| password | password123 | N/A | The password when leveraging the CredentialsSettingsVars credential provider. |
| secret | password123 | N/A | The secret password when leveraging the CredentialsSettingsVars credential provider. |
| connection_options | N/A | {"netmiko": {"extras": {"global_delay_factor": 1}}} | Set Nornir connection options globally to be used with all connections. |
| use_config_context | {"secrets": True, "connection_options": True} | {"secrets": False, "connection_options": False} | Whether to pull Secret Access Type, and/or Connection Options from Config Context. |
| connection_secret_path | "my_plugin.newos" | Dotted expression of the dictionary path where a device secret should be stored for a given Nornir Plugin. | |
| secret_access_type | "SSH" | "GENERIC" | Type of Secret Access Type to use. Examples. "GENERIC", "CONSOLE", "GNMI", "HTTP", "NETCONF", "REST", "RESTCONF", "SNMP", "SSH" |
allowed_location_types |
["Site"] | [] | The location types you would like to be automatically grouped. |
denied_location_types |
["Region"] | [] | The location types you would like to NOT be automatically grouped. |
Note: The default value for
connection_secret_pathis "nautobot_plugin_nornir.plugins.credentials.env_vars.CredentialsEnvVars", left here to import rendering of the table.
The default value for nornir_settings is below. To override it, copy the whole dictionary and edit the keys you need.
PLUGINS_CONFIG = {
"nautobot_plugin_nornir": {
"nornir_settings": {
"inventory": "nautobot_plugin_nornir.plugins.inventory.nautobot_orm.NautobotORMInventory",
"credentials": "nautobot_plugin_nornir.plugins.credentials.env_vars.CredentialsEnvVars",
"runner": {
"plugin": "threaded",
"options": {
"num_workers": 20,
},
},
},
}
}
The plugin behavior can be extended further with config context data. The plugin currently implements two options: Nornir connection options, and secrets. The supported settings are listed below.
| Key | Description |
|---|---|
| connection_options | Dictionary representation of a Nornir Plugins connection options. |
| connection_secret_path | Dotted expression of the dictionary path where a device secret should be stored for a given Nornir Plugin. |
| secret_access_type | Type of Secret Access Type to use. Examples. "GENERIC", "CONSOLE", "GNMI", "HTTP", "NETCONF", "REST", "RESTCONF", "SNMP", "SSH" |
For details on the credentials, and inventory please see their respective documentation.