summaryrefslogtreecommitdiff
path: root/roles/vm/network/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-12-09 01:53:23 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-12-09 01:53:23 +0100
commit755a54f2233e2aa9a27d3ab018879f7efbe8c501 (patch)
tree5d61aaafac00352b99a52dc20e13ba3fd7a35f34 /roles/vm/network/templates
parentfixed acmetool self-signed cert handling (diff)
parentvm installation works now again (diff)
Merge branch 'new-repo-structure'
Diffstat (limited to 'roles/vm/network/templates')
-rw-r--r--roles/vm/network/templates/interfaces.j210
-rw-r--r--roles/vm/network/templates/netplan.yaml.j210
-rw-r--r--roles/vm/network/templates/resolv.conf.j24
3 files changed, 17 insertions, 7 deletions
diff --git a/roles/vm/network/templates/interfaces.j2 b/roles/vm/network/templates/interfaces.j2
index 542e18d6..829a3e7d 100644
--- a/roles/vm/network/templates/interfaces.j2
+++ b/roles/vm/network/templates/interfaces.j2
@@ -8,10 +8,10 @@ auto lo
iface lo inet loopback
# The primary network interface
-auto {{ vm_network.primary.interface }}
-iface {{ vm_network.primary.interface }} inet static
- address {{ vm_network.primary.ip }}
- netmask {{ vm_network.primary.mask }}
- gateway {{ vm_network.primary.gateway }}
+auto {{ network.primary.interface }}
+iface {{ network.primary.interface }} inet static
+ address {{ network.primary.ip }}
+ netmask {{ network.primary.mask }}
+ gateway {{ network.primary.gateway }}
pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
diff --git a/roles/vm/network/templates/netplan.yaml.j2 b/roles/vm/network/templates/netplan.yaml.j2
new file mode 100644
index 00000000..0d78ab46
--- /dev/null
+++ b/roles/vm/network/templates/netplan.yaml.j2
@@ -0,0 +1,10 @@
+# This file describes the network interfaces available on your system
+# For more information, see netplan(5).
+network:
+ version: 2
+ renderer: networkd
+ ethernets:
+ {{ network.primary.interface }}:
+ addresses: [ {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} ]
+ gateway4: {{ network.primary.gateway }}
+ accept-ra: false
diff --git a/roles/vm/network/templates/resolv.conf.j2 b/roles/vm/network/templates/resolv.conf.j2
index 86d4201e..a32ec181 100644
--- a/roles/vm/network/templates/resolv.conf.j2
+++ b/roles/vm/network/templates/resolv.conf.j2
@@ -1,4 +1,4 @@
-{% for nsrv in vm_network.nameservers %}
+{% for nsrv in network.nameservers %}
nameserver {{ nsrv }}
{% endfor %}
-search {{ vm_network.domain }}
+search {{ network.domain }}