From cf686f8018e32a932ba5748071d679a4a60530fa Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 8 Dec 2021 17:04:04 -0500 Subject: [PATCH] Prefer IPv4 deployment over IPv6 when both are available Some older vintages of RHEL and clones do not support IPv4, best to prefer ipv4 to avoid messing up on places that have ipv6 configured. --- .../usr/lib/dracut/hooks/pre-trigger/01-confluent.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh index 1d183cc9..72a80425 100644 --- a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh +++ b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh @@ -71,13 +71,15 @@ if [ ! -z "$dnsdomain" ] && [ "$dnsdomain" != "null" ]; then fi v6cfg=$(grep ^ipv6_method: /etc/confluent/confluent.deploycfg) v6cfg=${v6cfg#ipv6_method: } -if [ "$v6cfg" = "static" ]; then +v4cfg=$(grep ^ipv4_method: /etc/confluent/confluent.deploycfg) +v4cfg=${v4cfg#ipv4_method: } +if [ "$v4cfg" = "static" ] || [ "$v4cfg" = "dhcp" ]; then + mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) + mgr=${mgr#deploy_server: } +else mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg) mgr=${mgr#deploy_server_v6: } mgr="[$mgr]" -else - mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) - mgr=${mgr#deploy_server: } fi profilename=$(grep ^profile: /etc/confluent/confluent.deploycfg) profilename=${profilename#profile: }