OPNsense Dashboard

This role configures the OPNsense web UI dashboard widget layout via the REST API.

Overview

This role configures the OPNsense web UI dashboard widget layout via the REST API. It applies a defined widget layout including widget positions, sizes, and per-widget configurations (e.g., selected interfaces for traffic graph, thermal sensors selection). The layout is always applied to ensure consistency.

What This Role Does

  1. POST widget layout to /api/core/dashboard/save_widgets
    • Sends the full widget list with positions, sizes, and configurations
    • API returns {"result": "saved"}

The role always applies the desired layout. This is a lightweight API call that ensures the dashboard matches the defined configuration.

Role Variables

VariableDescription
vault_opnsense_bjoffrey_user_api_keyOPNsense API key (from vault)
vault_opnsense_bjoffrey_user_api_secretOPNsense API secret (from vault)
opnsense_dashboard_widgetsList of widget definitions
opnsense_dashboard_validate_certsValidate SSL certificates
opnsense_dashboard_optionsDashboard-level options

Widget definition fields:

FieldTypeDescription
idWidget identifier
xintHorizontal position (0-11, 12-column grid)
yintVertical position in pixels
wint/nullWidth in columns (null = default)
hintHeight in pixels
minWintMinimum width in columns
widgetdictWidget-specific configuration

Notes

  • The role always applies the full widget list, replacing the current layout each time the role is run