summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-02-14 14:42:23 +0100
committerChristian Pointner <equinox@spreadspace.org>2024-02-14 14:42:23 +0100
commite5789acf5d258d10cf80feb4baf06e58d3fae334 (patch)
tree7b4a43e327ba6e53a7d3116ab40b935aac69f1ba /roles
parentele-calypso: add volume for /srv/video (diff)
vm/*/network: add support for additinal addresses
Diffstat (limited to 'roles')
-rw-r--r--roles/monitoring/grafana/files/dashboard-network-ups-tools.json55
-rw-r--r--roles/vm/guest/network/templates/interfaces/simple.j26
-rw-r--r--roles/vm/host/network/templates/interfaces/simple.j26
3 files changed, 44 insertions, 23 deletions
diff --git a/roles/monitoring/grafana/files/dashboard-network-ups-tools.json b/roles/monitoring/grafana/files/dashboard-network-ups-tools.json
index 451b62e2..468bae82 100644
--- a/roles/monitoring/grafana/files/dashboard-network-ups-tools.json
+++ b/roles/monitoring/grafana/files/dashboard-network-ups-tools.json
@@ -15,7 +15,7 @@
"type": "grafana",
"id": "grafana",
"name": "Grafana",
- "version": "9.2.3"
+ "version": "10.1.0"
},
{
"type": "datasource",
@@ -131,7 +131,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -201,7 +201,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -271,7 +271,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -341,7 +341,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -411,7 +411,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -481,7 +481,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -551,7 +551,7 @@
},
"textMode": "name"
},
- "pluginVersion": "9.2.3",
+ "pluginVersion": "10.1.0",
"targets": [
{
"datasource": {
@@ -576,7 +576,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 3
+ "y": 12
},
"id": 43,
"panels": [],
@@ -607,6 +607,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -646,7 +647,7 @@
"h": 6,
"w": 6,
"x": 0,
- "y": 4
+ "y": 13
},
"id": 61,
"options": {
@@ -701,6 +702,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -740,7 +742,7 @@
"h": 6,
"w": 6,
"x": 6,
- "y": 4
+ "y": 13
},
"id": 78,
"options": {
@@ -795,6 +797,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -834,7 +837,7 @@
"h": 6,
"w": 6,
"x": 12,
- "y": 4
+ "y": 13
},
"id": 79,
"options": {
@@ -889,6 +892,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -928,7 +932,7 @@
"h": 6,
"w": 6,
"x": 18,
- "y": 4
+ "y": 13
},
"id": 80,
"options": {
@@ -983,6 +987,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -1021,7 +1026,7 @@
"h": 6,
"w": 12,
"x": 0,
- "y": 10
+ "y": 19
},
"id": 81,
"options": {
@@ -1076,6 +1081,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -1114,7 +1120,7 @@
"h": 6,
"w": 6,
"x": 12,
- "y": 10
+ "y": 19
},
"id": 82,
"options": {
@@ -1169,6 +1175,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -1207,7 +1214,7 @@
"h": 6,
"w": 6,
"x": 18,
- "y": 10
+ "y": 19
},
"id": 83,
"options": {
@@ -1262,6 +1269,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -1300,7 +1308,7 @@
"h": 6,
"w": 12,
"x": 0,
- "y": 16
+ "y": 25
},
"id": 84,
"options": {
@@ -1355,6 +1363,7 @@
"tooltip": false,
"viz": false
},
+ "insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
@@ -1393,7 +1402,7 @@
"h": 6,
"w": 12,
"x": 12,
- "y": 16
+ "y": 25
},
"id": 85,
"options": {
@@ -1425,8 +1434,8 @@
"type": "timeseries"
}
],
- "refresh": "",
- "schemaVersion": 37,
+ "refresh": "1m",
+ "schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
@@ -1456,13 +1465,13 @@
]
},
"time": {
- "from": "now-6h",
+ "from": "now-24h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Network UPS Tools",
"uid": "ddRxfy67z",
- "version": 2,
+ "version": 1,
"weekStart": ""
-} \ No newline at end of file
+}
diff --git a/roles/vm/guest/network/templates/interfaces/simple.j2 b/roles/vm/guest/network/templates/interfaces/simple.j2
index 26e8aec2..67665f57 100644
--- a/roles/vm/guest/network/templates/interfaces/simple.j2
+++ b/roles/vm/guest/network/templates/interfaces/simple.j2
@@ -3,9 +3,15 @@
{% if 'gateway' in interface %}
gateway {{ interface.gateway }}
{% endif %}
+{% for address in interface.additional_addresses | default([]) %}
+ up /bin/ip addr add dev $IFACE {{ address }}/32
+{% endfor %}
{% for route in interface.static_routes | default([]) %}
up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
{% for route in interface.static_routes | default([]) | reverse %}
down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
+{% for address in interface.additional_addresses | default([]) | reverse %}
+ down /bin/ip addr del dev $IFACE {{ address }}/32
+{% endfor %}
diff --git a/roles/vm/host/network/templates/interfaces/simple.j2 b/roles/vm/host/network/templates/interfaces/simple.j2
index 26e8aec2..67665f57 100644
--- a/roles/vm/host/network/templates/interfaces/simple.j2
+++ b/roles/vm/host/network/templates/interfaces/simple.j2
@@ -3,9 +3,15 @@
{% if 'gateway' in interface %}
gateway {{ interface.gateway }}
{% endif %}
+{% for address in interface.additional_addresses | default([]) %}
+ up /bin/ip addr add dev $IFACE {{ address }}/32
+{% endfor %}
{% for route in interface.static_routes | default([]) %}
up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
{% for route in interface.static_routes | default([]) | reverse %}
down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
+{% for address in interface.additional_addresses | default([]) | reverse %}
+ down /bin/ip addr del dev $IFACE {{ address }}/32
+{% endfor %}