Deploy Netos Enterprise
- Deploy Netos Enterprise Plugins
- Deploy Netos User Preferences & Field Choices
- Netos Reporting Cache Pre-Load
- Create NetBox API Token for Airflow
Deploy Netos Enterprise Plugins
Introduction
This guide summarizes how to deploy licensed Netos enterprise plugins, which are compiled and licensed per-customer. The Netos Plugin architecture is as follows, and you can find out more here.
License Status
You can check the license status for each plugin in Netos Core.
Securely Deploy with Cloudflare Zero Trust
Typically you will deploy via Cloudflare which is a two-stage authentication process built for Netos NetBox and Netos Pod deployments not directly connected to the Netos internal network. Tokens and enterprise settings are configured in the Netos Enterprise Plugin environment in Semaphore.
- Using the following ID and secret the deployment playbook will authenticate to Cloudflare Zero Trust to enable pass through to our secure GitLab server.
CF_ACCESS_CLIENT_ID
CF_ACCESS_CLIENT_SECRET
- The playbook will then authenticate to your dedicated private repository using your customer ID and token:
CUSTOMER_ID
CUSTOMER_TOKEN
- The plugins are downloaded and installed.
Deployment Process
First the Python dependencies will be checked and if missing installed using pip
.
Once the plugins are deployed, the lates plugin versions are displayed.
Enterprise Support
Please speak with Netos Support for any assistance with this process. This is just a high-level guide.
Deploy Netos User Preferences & Field Choices
Introduction
Netos enriches the standard NetBox dataset, and this playbook imports settings and views to align the Netos plugins with NetBox. When running the playbook, it will insert markers in the configuration.py
file to ensure that duplicates are not added.
# BEGIN netos-field-choices ANSIBLE MANAGED BLOCK
FIELD_CHOICES = {
'dcim.Device.status+': (
('imported', 'Imported', 'purple'),
('detected', 'Detected', 'blue'),
('discovery_failed', 'Discovery Failed', 'orange'),
('polling_error', 'Polling Error', 'red'),
)
}
# END netos-field-choices ANSIBLE MANAGED BLOCK
# BEGIN netos-preferences ANSIBLE MANAGED BLOCK
DEFAULT_USER_PREFERENCES = {
"ui": {
"colormode": "light"
},
"tables": {
"ASNTable": {
"columns": [
"asn",
"rir",
"site_count",
"provider_count",
"sites",
"description"
]
},
# END netos-preferences ANSIBLE MANAGED BLOCK
If you need to add custom FIELD_CHOICES or user preferences either include the standard Netos settings or make changes between the markers.
Run the Playbook
Running the playbook checks and deploys the settings.
Default User Preferences
Each user can set their profile preferences, for example, from the screenshot below. These "default user preferences" can also be set globally, i.e. for all users, which is what this playbook does.
The primary Netos use case is to customise table layouts outside of the Netos plugins (like DCIM Devices). For example, where Netos enriches and add useful data, that can be included in the default user settings for all users.
Field Choices
Certain functions in the Netos Fabric plugin change the status of devices. In order to expand the field choices, Netos uses the NetBox standard Data & Validation Field Choices settings to add additional status values:
Netos Reporting Cache Pre-Load
Introduction
Some reports require large database queries to prepare the data, which can take 10-30 seconds to run. From a user perspective this is too slow.
Netos has developed a caching engine that pre-loads the report caches so the charts in reports, like above, loads in an acceptable time frame (usually 2-3 seconds).
Pre-Load Job
At present, there is a playbook that first flushes the current cache (stored in redis
) and then pre-loads the cache. This task is also initiated after the Netos plugins are deployed.
The task in Semaphore will probably be depreciated in the future once https://github.com/netbox-community/netbox/issues/16971 is resolved.
Scheduling
Depending on the frequency of updates on the NetBox instance, the scheduler in Semaphore can be configured to automate the cache refresh. By default, this is every hour.
Create NetBox API Token for Airflow
Introduction
This task will provision an API key in NetBox to allow Netos Pod (Airflow) to pull and push data into NetBox. The playbook will perform the following steps:
- Create a NetBox user called
airflow_api
with asuperuser
role. - Generate an API key for the airflow_api user (meaning that any updates from Airflow are clearly attributed to Airflow, i.e. Netos Pod).
- Configure the
NETBOX_API_KEY
variable in Airflow.
This solution assumes that Airflow is running on the local server. For remotely connected NetBox <> Netos Pod configurations, please set the API manually in Airflow.
The Playbook
The "Create API User" task failed because the user exists. In this case it will refresh the token used by Airflow.
Airflow
The NetBox API key is created. If the key is wrong, the Global Orchestration DAG will not start and will show an authentication error in the logs.