From 876ed4209fe2a13a65e3de2d3fdfb1364764141b Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Mon, 19 Feb 2024 16:13:25 -0500 Subject: [PATCH] fix: Allow network to restart when wireless or team connection is specified When wireless or team connection is specified, we should allow network to restart by default regardless of whether network packages are changed on the managed host. The commit will fix the situation that users forget to explicitly specify `network_allow_restart: true` when specifying wireless or team connection. Signed-off-by: Wen Liang --- defaults/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fb0142cd4..28d8cab73 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,8 +2,6 @@ --- network_connections: [] -network_allow_restart: false - # Ansible distribution identifiers that the role treats like RHEL __network_rh_distros: - AlmaLinux @@ -50,6 +48,11 @@ __network_packages_default_team: ["{% if __network_team_connections_defined %}NetworkManager-team{% endif %}"] +# if wireless or team connection is specified, NetworkManager should be +# allowed to restart by default +network_allow_restart: "{{ __network_wireless_connections_defined or + __network_team_connections_defined }}" + # wpa_supplicant is required if any 802.1x or wireless connections are defined __network_wpa_supplicant_required: "{{ __network_ieee802_1x_connections_defined or