From e700812dad60ee8b2b3345bf821640450f4f53cd Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 31 Aug 2025 17:17:27 +0200 Subject: Allow network role to configure ipv6 --- roles/network/meta/argument_specs.yml | 6 ++++++ roles/network/templates/eth0-connection.nmconnection.j2 | 6 ++++++ roles/network/templates/wifi-connection.nmconnection.j2 | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'roles/network') diff --git a/roles/network/meta/argument_specs.yml b/roles/network/meta/argument_specs.yml index 58cc4efa..7cb3f62d 100644 --- a/roles/network/meta/argument_specs.yml +++ b/roles/network/meta/argument_specs.yml @@ -18,3 +18,9 @@ argument_specs: network_ipv4_gateway: type: "str" description: "The network IP(4) gateway to configure when provided" + network_ipv6_address: + type: "str" + description: "The network IP(6) address to configure when provided" + network_ipv6_gateway: + type: "str" + description: "The network IP(6) gateway to configure when provided" diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2 index ae573cf1..b981489a 100644 --- a/roles/network/templates/eth0-connection.nmconnection.j2 +++ b/roles/network/templates/eth0-connection.nmconnection.j2 @@ -16,6 +16,12 @@ method=auto [ipv6] addr-gen-mode=default +{% if network_ipv6_address is defined %} +method=manual +addresses={{ network_ipv6_address }} +gateway={{ network_ipv6_gateway }} +{% else %} method=auto +{% endif %} [proxy] diff --git a/roles/network/templates/wifi-connection.nmconnection.j2 b/roles/network/templates/wifi-connection.nmconnection.j2 index deec573d..52cf2d19 100644 --- a/roles/network/templates/wifi-connection.nmconnection.j2 +++ b/roles/network/templates/wifi-connection.nmconnection.j2 @@ -24,6 +24,12 @@ method=auto [ipv6] addr-gen-mode=default +{% if network_ipv6_address is defined %} +method=manual +addresses={{ network_ipv6_address }} +gateway={{ network_ipv6_gateway }} +{% else %} method=auto +{% endif %} [proxy] -- cgit v1.2.3