summaryrefslogtreecommitdiff
path: root/templates/interfaces/loopback
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/loopback')
-rw-r--r--templates/interfaces/loopback/node.def8
-rw-r--r--templates/interfaces/loopback/node.tag/address/node.def6
-rw-r--r--templates/interfaces/loopback/node.tag/description/node.def2
3 files changed, 16 insertions, 0 deletions
diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def
new file mode 100644
index 0000000..50df935
--- /dev/null
+++ b/templates/interfaces/loopback/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: "loopback interface name"
+syntax: exec " \
+ if [ -z \"`ip addr | grep $(@) `\" ]; then \
+ echo loopback interface $(@) doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; "
diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def
new file mode 100644
index 0000000..2e7e106
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/address/node.def
@@ -0,0 +1,6 @@
+multi:
+type: ipv4net
+help: "Set IPv4 address and prefix for this interface"
+# TODO make sure 127.0.0.0/8 not in here.
+create: "ip addr add $(@) dev $(../@)"; "error setting address $(@) on dev $(../@)"
+delete: "ip addr del $(@) dev $(../@)"; "error deleteing address $(@) on dev $(../@)"
diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def
new file mode 100644
index 0000000..abd0a26
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: "description for this interface"