From 6938bba2d3cb15a4a930be6ac748110a6cdaa57b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 26 Sep 2025 13:42:29 -0400 Subject: [PATCH] Have confignet pause until connectivity restored If we are reconfiguring network for a diskless node, wait for things to settle back in before continuing. --- .../common/profile/scripts/confignet | 17 +++++++++++++++++ .../profiles/default/scripts/onboot.sh | 2 +- .../profiles/default/scripts/onboot.sh | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 18945a3d..41deed4c 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -460,6 +460,9 @@ class NetworkManager(object): if __name__ == '__main__': + checktarg = None + if '-c' in sys.argv: + checktarg = sys.argv[sys.argv.index('-c') + 1] havefirewall = subprocess.call(['systemctl', 'status', 'firewalld']) havefirewall = havefirewall == 0 if havefirewall: @@ -576,4 +579,18 @@ if __name__ == '__main__': except Exception: maxwait -= 1 time.sleep(1) + maxwait = 10 + if checktarg: + while maxwait: + try: + addrinf = socket.getaddrinfo(checktarg, 443)[0] + psock = socket.socket(addrinf[0], socket.SOCK_STREAM) + psock.settimeout(10) + psock.connect(addrinf[4]) + psock.close() + break + except Exception: + maxwait -= 1 + time.sleep(1) + diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/onboot.sh b/confluent_osdeploy/el8-diskless/profiles/default/scripts/onboot.sh index 65b13ff1..0bc3777b 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/onboot.sh +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/onboot.sh @@ -59,7 +59,7 @@ rpm --import /etc/pki/rpm-gpg/* run_remote_python add_local_repositories run_remote_python syncfileclient -run_remote_python confignet +run_remote_python confignet -c $confluent_mgr run_remote onboot.custom # onboot scripts may be placed into onboot.d, e.g. onboot.d/01-firstaction.sh, onboot.d/02-secondaction.sh diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/onboot.sh b/confluent_osdeploy/el9-diskless/profiles/default/scripts/onboot.sh index 80f95870..b8a55cf1 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/onboot.sh +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/onboot.sh @@ -53,7 +53,7 @@ rpm --import /etc/pki/rpm-gpg/* run_remote_python add_local_repositories run_remote_python syncfileclient -run_remote_python confignet +run_remote_python confignet -c $confluent_mgr run_remote onboot.custom # onboot scripts may be placed into onboot.d, e.g. onboot.d/01-firstaction.sh, onboot.d/02-secondaction.sh