summaryrefslogtreecommitdiffstats
path: root/roles/network/templates
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-08-11 00:32:09 +0200
committerAhmed Abdelhalim <[email protected]>2025-08-11 16:29:32 +0200
commitbed8aaaeb0b63b2072fbd030d76f8f928432e7b8 (patch)
tree72ef0ee02dfeb29e6f3971c6948e6d989b2dd441 /roles/network/templates
parenta05655e7c239b6f8167e36b141a1a3a060128d45 (diff)
Add network ipv4 configurations
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