summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/network/defaults/main.yml1
-rw-r--r--roles/network/meta/argument_specs.yml10
-rw-r--r--roles/network/templates/eth0-connection.nmconnection.j28
-rw-r--r--roles/network/templates/wifi-connection.nmconnection.j26
4 files changed, 20 insertions, 5 deletions
diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml
index 9497f83f..20776341 100644
--- a/roles/network/defaults/main.yml
+++ b/roles/network/defaults/main.yml
@@ -2,3 +2,4 @@
network_wifi_ssid: ""
network_wifi_pass: ""
network_prefer_ipv4: false
+network_ipv6_disabled: false
diff --git a/roles/network/meta/argument_specs.yml b/roles/network/meta/argument_specs.yml
index 74060d0d..b6c521fe 100644
--- a/roles/network/meta/argument_specs.yml
+++ b/roles/network/meta/argument_specs.yml
@@ -25,6 +25,16 @@ argument_specs:
type: "str"
description: "Static IPv6 default route via router link-local — set when router RA is disabled"
required: false
+ network_prefer_ipv4:
+ type: "bool"
+ description: "Prefer IPv4 over IPv6 for address resolution"
+ required: false
+ default: false
+ network_ipv6_disabled:
+ type: "bool"
+ description: "Disable IPv6 on all network connections"
+ required: false
+ default: false
network_bridge_interface:
type: "str"
description: "Physical NIC to enslave as vmbr0 bridge port"
diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2
index d6d2ea86..032b18a3 100644
--- a/roles/network/templates/eth0-connection.nmconnection.j2
+++ b/roles/network/templates/eth0-connection.nmconnection.j2
@@ -28,13 +28,13 @@ method=auto
[ipv6]
addr-gen-mode=default
-{% if network_bridge_interface is defined %}
+{% if network_bridge_interface is defined or network_ipv6_disabled %}
method=disabled
-{% else %}
+{% elif network_ipv6_gateway is defined %}
method=auto
-{% if network_ipv6_gateway is defined %}
routes=::/0,{{ network_ipv6_gateway }},100
-{% endif %}
+{% else %}
+method=auto
{% endif %}
[proxy]
diff --git a/roles/network/templates/wifi-connection.nmconnection.j2 b/roles/network/templates/wifi-connection.nmconnection.j2
index 5b4ab185..01dff2eb 100644
--- a/roles/network/templates/wifi-connection.nmconnection.j2
+++ b/roles/network/templates/wifi-connection.nmconnection.j2
@@ -27,9 +27,13 @@ method=auto
[ipv6]
addr-gen-mode=default
+{% if network_ipv6_disabled %}
+method=disabled
+{% elif network_ipv6_gateway is defined %}
method=auto
-{% if network_ipv6_gateway is defined %}
routes=::/0,{{ network_ipv6_gateway }},100
+{% else %}
+method=auto
{% endif %}
[proxy]