community.openwrt.uci module – Controls OpenWrt UCI
Note
This module is part of the community.openwrt collection (version 0.5.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.openwrt.
To use it in a playbook, specify: community.openwrt.uci.
Synopsis
The community.openwrt.uci module is a Ansible wrapper for OpenWrt’s
uci.It supports all the command line functionality plus some extra commands.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Whether to automatically commit changes. Choices:
|
|
The default is The Choices:
|
|
Value(s) to match sections against. Option value to find if Dict of options/values if Lists are compared in order. Required when |
|
Space separated list or list of keys not in |
|
New name when Desired name when |
|
When Choices:
|
|
When Choices:
|
|
Section type for If not specified, defaults to the value of |
|
When Choices:
|
|
The value for various commands. |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: full |
Returns details on what has changed (or possibly needs changing in |
|
Platform: OpenWrt |
Target platform for this module. |
Examples
# Find a section of type wifi-iface with matching name or matching attributes.
# If not found create it and set the attributes from find.
# Unconditionally set the attributes from value and delete all other options.
- community.openwrt.uci:
command: section
config: wireless
type: wifi-iface
name: ap0
find:
device: radio0
ssid: My SSID
value:
encryption: none
replace: yes
# Find a matching wifi-iface and delete it.
- community.openwrt.uci:
command: absent
config: wireless
type: wifi-iface
find:
ssid: My SSID broken
# Find a matching wifi-iface and delete the options key and encryption.
- community.openwrt.uci:
command: absent
config: wireless
type: wifi-iface
find:
ssid: My SSID public
value:
- key
- encryption
# Commit changes and notify.
- community.openwrt.uci:
cmd: commit
notify: restart wifi
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Command executed. Returned: always Sample: |
|
Output of the Returned: always Sample: |
|