Rename openwrt-image role to openwrt/image
[noc.git] / ansible / roles / openwrt / openwrt-image / templates / uci.j2
diff --git a/ansible/roles/openwrt/openwrt-image/templates/uci.j2 b/ansible/roles/openwrt/openwrt-image/templates/uci.j2
new file mode 100644 (file)
index 0000000..3cc480b
--- /dev/null
@@ -0,0 +1,15 @@
+{{ ansible_managed | comment }}
+
+{% for section in item.value %}
+config {{ section.name }}
+{% for option, value in section.options.items() %}
+{%   if value is iterable and value is not string %}
+{%      for v in value %}
+  list {{ option }} '{{ v }}'
+{%      endfor %}
+{%   else %}
+  option {{ option }} '{{ value }}'
+{%   endif %}
+{% endfor %}
+
+{% endfor %}