diff options
author | Christian Pointner <equinox@spreadspace.org> | 2018-12-02 03:12:32 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2018-12-02 03:12:51 +0100 |
commit | b9b2f51bc8547f0cb4f9c354956650841941f119 (patch) | |
tree | 1fd46f3597d106f040eb64b47e63ab7cc69bcf30 /roles/vm/network/templates | |
parent | some variable cleanup (diff) |
merge over installer roles from realraum repo
Diffstat (limited to 'roles/vm/network/templates')
-rw-r--r-- | roles/vm/network/templates/interfaces.j2 | 10 | ||||
-rw-r--r-- | roles/vm/network/templates/netplan.yaml.j2 | 10 | ||||
-rw-r--r-- | roles/vm/network/templates/resolv.conf.j2 | 4 |
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 }} |