diff options
Diffstat (limited to 'roles/network/templates')
| -rw-r--r-- | roles/network/templates/eth0-connection.nmconnection.j2 | 4 | ||||
| -rw-r--r-- | roles/network/templates/wifi-connection.nmconnection.j2 | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2 index dab5a6de..493afdf7 100644 --- a/roles/network/templates/eth0-connection.nmconnection.j2 +++ b/roles/network/templates/eth0-connection.nmconnection.j2 @@ -10,7 +10,9 @@ autoconnect=true method=manual addresses={{ network_ipv4_address }} gateway={{ network_ipv4_gateway }} +{% if network_ipv4_dns is defined %} dns={{ network_ipv4_dns }} +{% endif %} {% else %} method=auto {% endif %} @@ -21,7 +23,9 @@ addr-gen-mode=default method=manual addresses={{ network_ipv6_address }} gateway={{ network_ipv6_gateway }} +{% if network_ipv6_dns is defined %} dns={{ network_ipv6_dns }} +{% endif %} {% else %} method=auto {% endif %} diff --git a/roles/network/templates/wifi-connection.nmconnection.j2 b/roles/network/templates/wifi-connection.nmconnection.j2 index c04077c0..0fd69cb1 100644 --- a/roles/network/templates/wifi-connection.nmconnection.j2 +++ b/roles/network/templates/wifi-connection.nmconnection.j2 @@ -18,7 +18,9 @@ psk={{ network_wifi_pass }} method=manual addresses={{ network_ipv4_address }} gateway={{ network_ipv4_gateway }} +{% if network_ipv4_dns is defined %} dns={{ network_ipv4_dns }} +{% endif %} {% else %} method=auto {% endif %} @@ -29,7 +31,9 @@ addr-gen-mode=default method=manual addresses={{ network_ipv6_address }} gateway={{ network_ipv6_gateway }} +{% if network_ipv6_dns is defined %} dns={{ network_ipv6_dns }} +{% endif %} {% else %} method=auto {% endif %} |
