From bed8aaaeb0b63b2072fbd030d76f8f928432e7b8 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:32:09 +0200 Subject: Add network ipv4 configurations --- roles/network/templates/eth0-connection.nmconnection.j2 | 7 ++++++- roles/network/templates/wifi-connection.nmconnection.j2 | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'roles/network/templates') 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 -- cgit v1.2.3