summaryrefslogtreecommitdiffstats
path: root/roles/network/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/network/templates')
-rw-r--r--roles/network/templates/eth0-connection.nmconnection.j27
-rw-r--r--roles/network/templates/wifi-connection.nmconnection.j26
2 files changed, 12 insertions, 1 deletions
diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2
index b5cbe276..ae573cf1 100644
--- a/roles/network/templates/eth0-connection.nmconnection.j2
+++ b/roles/network/templates/eth0-connection.nmconnection.j2
@@ -2,12 +2,17 @@
id=ethernet
type=ethernet
autoconnect=true
-interface-name=eth0
[ethernet]
[ipv4]
+{% if network_ipv4_address is defined %}
+method=manual
+addresses={{ network_ipv4_address }}
+gateway={{ network_ipv4_gateway }}
+{% else %}
method=auto
+{% endif %}
[ipv6]
addr-gen-mode=default
diff --git a/roles/network/templates/wifi-connection.nmconnection.j2 b/roles/network/templates/wifi-connection.nmconnection.j2
index 9fffbd12..deec573d 100644
--- a/roles/network/templates/wifi-connection.nmconnection.j2
+++ b/roles/network/templates/wifi-connection.nmconnection.j2
@@ -14,7 +14,13 @@ key-mgmt=wpa-psk
psk={{ network_wifi_pass }}
[ipv4]
+{% if network_ipv4_address is defined %}
+method=manual
+addresses={{ network_ipv4_address }}
+gateway={{ network_ipv4_gateway }}
+{% else %}
method=auto
+{% endif %}
[ipv6]
addr-gen-mode=default