summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-12-06 19:18:27 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-12-06 19:18:27 +0100
commit1fd7696d93eb792eca8b090f51cce475d249065f (patch)
treecfcee609ba4c871305bcbcde9f636c3591adad5e /roles
parentcloud/install: some more more tests for edis (diff)
add simple interfaces template for edis kvm hosts
Diffstat (limited to 'roles')
-rw-r--r--roles/cloud/post-install/tasks/edis-kvm.yml6
-rw-r--r--roles/cloud/post-install/templates/edis-kvm-interfaces.j221
2 files changed, 26 insertions, 1 deletions
diff --git a/roles/cloud/post-install/tasks/edis-kvm.yml b/roles/cloud/post-install/tasks/edis-kvm.yml
index eb91eb94..e8184e20 100644
--- a/roles/cloud/post-install/tasks/edis-kvm.yml
+++ b/roles/cloud/post-install/tasks/edis-kvm.yml
@@ -1,2 +1,6 @@
---
-# TODO: configure network interfaces (IPv6!)
+ ## TODO: this should use the role network/interfaces
+- name: configure network interfaces
+ template:
+ src: edis-kvm-interfaces.j2
+ dest: /etc/network/interfaces
diff --git a/roles/cloud/post-install/templates/edis-kvm-interfaces.j2 b/roles/cloud/post-install/templates/edis-kvm-interfaces.j2
new file mode 100644
index 00000000..1cb7c511
--- /dev/null
+++ b/roles/cloud/post-install/templates/edis-kvm-interfaces.j2
@@ -0,0 +1,21 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+source /etc/network/interfaces.d/*
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+
+auto {{ network.primary.name }}
+iface {{ network.primary.name }} inet static
+ pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+ address {{ network.primary.address | ansible.utils.ipaddr('address') }}
+ netmask {{ network.primary.address | ansible.utils.ipaddr('netmask') }}
+ gateway {{ network.primary.gateway }}
+
+iface {{ network.primary.name }} inet6 static
+ address {{ network.primary.address6 }}
+ gateway {{ network.primary.gateway6 }}