Skip to main content

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.

image.png

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.

image.png

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.

image.png

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:

image.png