aboutsummaryrefslogtreecommitdiffstats
path: root/uci.py
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-04-08 15:10:14 +0200
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-04-08 15:10:14 +0200
commit90f9683fbba681d81a1f7925ce15c37698e88392 (patch)
treee4cb63d5303cb81f4004c6992581f67dafe6063a /uci.py
parentDefaults the index to 0 (diff)
downloadansible-uci-90f9683fbba681d81a1f7925ce15c37698e88392.tar.xz
Improve part with examples in documentation
Diffstat (limited to 'uci.py')
-rw-r--r--uci.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/uci.py b/uci.py
index 0ad3eae..e9411ca 100644
--- a/uci.py
+++ b/uci.py
@@ -76,11 +76,29 @@ options:
notes: []
'''
EXAMPLES = '''
+# Set option in named section dhcp.lan.start to 100
- uci: p=dhcp s=lan name=start val=100
+
+# Set option (and create if not exists) in named section of type host dhcp.computer.ip
- uci: p=dhcp s=computer type=host name=ip val=1.0.0.0
-- uci: p=dhcp s=computer type=host name=ip val=1.0.0.0 state=absent
+
+# Delete option in named section dhcp.computer.ip (doesn't delete empty section)
+- uci: p=dhcp s=computer name=ip val=1.0.0.0 state=absent
+
+# Create new named section of type host
- uci: p=dhcp s=computer2 type=host
+
+# Delete whole named section
- uci: p=dhcp s=computer2 state=absent
+
+# Please note that using anonymous section with Ansible is not good idea.
+# The unique anonymous sections (always with index 0) are to only reasonable exception
+
+# Set option in unique anonymous section of type dnsmasq dhcp.@dnsmasq[0].domain to example.com
+- uci: p=dhcp type=dnsmasq name=domain val=example.com
+
+# ... or specify the index explicitly
+- uci: p=dhcp type=dnsmasq index=0 name=domain val=example.com
'''