Setting of uci config values on openwrt systems. This library module can be easily used by playbooks and roles.
Official UCI documentation: [http://wiki.openwrt.org/doc/uci] and [http://wiki.openwrt.org/doc/techref/uci]
- lua interpreter
Set a value:
uci:
command: set
config: "{{config}}"
section: "{{section}}"
type: "{{type}}"
index: "{{index}}"
option: "{{option}}"
value: "{{value}}"
Set values as object:
uci:
command: set_object
config: "{{config}}"
section: "{{section}}"
type: "{{type}}"
index: "{{index}}"
option: "{{option}}"
values:
key: "{{value}}"
another_key: "{{another_value}}"
Delete a value:
uci:
command: delete
config: "{{config}}"
section: "{{section}}"
index: "{{index}}"
option: "{{option}}"
Commit:
uci:
command: commit
config: "{{config}}"
parameter | required | type | choices | comments |
---|---|---|---|---|
command | yes | string |
|
Specifies the UCI command |
config | yes | string | Specifies the UCI config. Mandatory for all commands | |
section | no | string | Specifies the UCI section name. Mandatory if no index is set. | |
type | no | string | Specifies the UCI section type. Mandatory if a section will be created. | |
index | no | number | Specifies the index for the item within a section-array. Mandatory if you changing values within section-arrays. | |
option | no | string | Specifies the UCI option name within sections. Mandatory for commands set, set_object and delete. | |
value | no | string | Specifies the value to set as section option. Mandatory for command 'set'. | |
values | no | string | Specifies the value to set as section option. Mandatory for command 'set_object'. |
See for UCI documentation:
- OpenWRT Wiki / The UCI System
- OpenWRT Wiki / UCI (Unified Configuration Interface) – Technical Reference
Got idea from: