uci¶
Salt execution module for OpenWrt configuration via ubus JSON-RPC.
Requires the uci proxy module to be configured and running.
UCI metadata fields are returned with underscore prefixes to avoid collision with UCI option names:
.type -> _type, .name -> _name, .anonymous -> _anonymous, .index -> _index
- saltext.uci_ubus.modules.ubus_jsonrpc.get(config, section=None, option=None)[source]¶
Read UCI configuration.
Returns the full config, a single section, or a single option value. UCI metadata fields (.type, .name, .anonymous, .index) are returned with underscore prefixes (_type, _name, _anonymous, _index).
CLI Example:
salt austru uci.get network salt austru uci.get network lan salt austru uci.get network lan proto
- saltext.uci_ubus.modules.ubus_jsonrpc.configs()[source]¶
List available UCI configuration packages.
CLI Example:
salt austru uci.configs
- saltext.uci_ubus.modules.ubus_jsonrpc.changes(config)[source]¶
Show uncommitted changes for a UCI package.
CLI Example:
salt austru uci.changes network
- saltext.uci_ubus.modules.ubus_jsonrpc.config_evidence(config)[source]¶
Return the configured UCI state for
configwrapped in a provenance envelope.Calls
config_export()for the payload and adds metadata describing what was collected, from where, when, and how.No storage side effect — the caller (runner, CLI, orchestration layer) decides where to persist the record.
CLI Example:
salt austru uci.config_evidence network salt austru uci.config_evidence dhcp
- saltext.uci_ubus.modules.ubus_jsonrpc.runtime_evidence(domain)[source]¶
Return observed runtime state for
domainwrapped in a provenance envelope.Valid domains:
network— interface operational state (network_dump())system— board identity + uptime/memory (system_board()+system_info())services— procd service state (service_list(verbose=True))
No storage side effect — the caller decides where to persist the record.
CLI Example:
salt bora uci.runtime_evidence network salt bora uci.runtime_evidence system salt bora uci.runtime_evidence services
- saltext.uci_ubus.modules.ubus_jsonrpc.config_export(config, format='json')[source]¶
Export live UCI config as a grouped sections dict.
Transforms the device config into the format consumed by
uci.managed(). Anonymous sections are emitted as singleton (_<type>) or multi-instance (_<type>swith_matchand_items).Use
format=pillarto redact sensitive values with Jinja2 pillar references, orformat=json(default) for plaintext.CLI Example:
salt austru uci.config_export network salt austru uci.config_export network format=pillar
- saltext.uci_ubus.modules.ubus_jsonrpc.config_export_all(format='json')[source]¶
Export all UCI config packages as a grouped dict.
CLI Example:
salt austru uci.config_export_all salt austru uci.config_export_all format=pillar
- saltext.uci_ubus.modules.ubus_jsonrpc.config_diff(config, sections)[source]¶
Compare live UCI config against declared sections and return drift.
Read-only – no writes are issued. Returns a categorized dict with
changed,new,removed,reordered, andsummary.CLI Example:
salt austru uci.config_diff network sections='{"lan": {"ipaddr": "10.0.0.2"}}'
- saltext.uci_ubus.modules.ubus_jsonrpc.set_(config, section, values)[source]¶
Set UCI option values on an existing section.
CLI Example:
salt austru uci.set network lan '{"proto": "static"}'
- saltext.uci_ubus.modules.ubus_jsonrpc.add(config, type_, name=None, values=None)[source]¶
Add a new UCI section.
CLI Example:
salt austru uci.add network interface name=wan2
- saltext.uci_ubus.modules.ubus_jsonrpc.delete(config, section, option=None)[source]¶
Delete a UCI section or option.
CLI Example:
salt austru uci.delete network wan2 salt austru uci.delete network lan dns
- saltext.uci_ubus.modules.ubus_jsonrpc.apply_(rollback=90)[source]¶
Commit and apply UCI changes with rollback safety.
CLI Example:
salt austru uci.apply salt austru uci.apply rollback=120
- saltext.uci_ubus.modules.ubus_jsonrpc.confirm()[source]¶
Confirm a pending apply, locking in the changes.
CLI Example:
salt austru uci.confirm
- saltext.uci_ubus.modules.ubus_jsonrpc.rollback()[source]¶
Manually trigger a rollback of the last apply.
CLI Example:
salt austru uci.rollback
- saltext.uci_ubus.modules.ubus_jsonrpc.revert(config)[source]¶
Discard staged (uncommitted) changes for a UCI package.
CLI Example:
salt austru uci.revert network
- saltext.uci_ubus.modules.ubus_jsonrpc.commit(config)[source]¶
Commit staged changes to /etc/config without reloading daemons.
CLI Example:
salt austru uci.commit network
- saltext.uci_ubus.modules.ubus_jsonrpc.state(config, section=None)[source]¶
Return runtime-merged UCI state (defaults + config + overrides).
CLI Example:
salt austru uci.state network salt austru uci.state network lan
- saltext.uci_ubus.modules.ubus_jsonrpc.system_board()[source]¶
Return system board information.
CLI Example:
salt austru uci.system_board
- saltext.uci_ubus.modules.ubus_jsonrpc.system_info()[source]¶
Return system info (memory, uptime, load).
CLI Example:
salt austru uci.system_info