diff --git a/host_vars/o34.oopen.de.yml b/host_vars/o34.oopen.de.yml index 0a1ddd5..7527d08 100644 --- a/host_vars/o34.oopen.de.yml +++ b/host_vars/o34.oopen.de.yml @@ -103,7 +103,8 @@ network_interfaces: # inline hook scripts pre-up: [] # pre-up script lines - up: [] # up script lines + up: + - route add -net 65.109.158.64 netmask 255.255.255.192 gw 65.109.158.65 dev enp6s0 post-up: [] # post-up script lines (alias for up) pre-down: [] # pre-down script lines (alias for down) down: [] # down script lines diff --git a/roles/network_interfaces/templates/etc/network/interfaces.d/device.j2 b/roles/network_interfaces/templates/etc/network/interfaces.d/device.j2 index 6697d1d..2b978fb 100644 --- a/roles/network_interfaces/templates/etc/network/interfaces.d/device.j2 +++ b/roles/network_interfaces/templates/etc/network/interfaces.d/device.j2 @@ -96,6 +96,7 @@ iface {{ config.device }} {{ config.family | default('inet', true) }} {{ config. {# #} {# nameservers #} +{% set ns = namespace(ips='') %} {%- if (config.nameservers is defined and config.nameservers) or (config.search is defined and config.search) %} # dns-* options are implemented by the resolvconf package, if installed # sets entries in /etc/resolv.conf @@ -106,8 +107,9 @@ iface {{ config.device }} {{ config.family | default('inet', true) }} {{ config. {% endif -%} {%- if (config.nameservers is defined) and config.nameservers %} {% for _ip in config.nameservers %} - dns-nameservers {{ _ip }} +{% set ns.ips = ns.ips + ' ' + _ip %} {% endfor %} + dns-nameservers{{ ns.ips }} {% endif %} {%- if (config.nameservers is defined and config.nameservers) or (config.search is defined and config.search) %}