From a385b1e93d248c36ae8eba07cc152987cc1efbc7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 28 Feb 2023 12:12:36 -0500 Subject: [PATCH] Try strategy to have confignet run confignet is special, it is designed to work when networking isn't right. So have it run during firstboot in case post fouled up the network for firstboot. --- .../el8/profiles/default/scripts/firstboot.sh | 11 ++++++++--- .../el8/profiles/default/scripts/post.sh | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh index 1762ed01..c343b26f 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -33,16 +33,21 @@ export nodename confluent_mgr confluent_profile exec >> /var/log/confluent/confluent-firstboot.log exec 2>> /var/log/confluent/confluent-firstboot.log chmod 600 /var/log/confluent/confluent-firstboot.log +if [ ! -f /etc/confluent/firstboot.ran ]; then + cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt + confluentpython /root/confignet + rm /root/confignet +fi + + while ! ping -c 1 $confluent_pingtarget >& /dev/null; do sleep 1 done + if [ ! -f /etc/confluent/firstboot.ran ]; then touch /etc/confluent/firstboot.ran - cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt - run_remote_python confignet - run_remote firstboot.custom # Firstboot scripts may be placed into firstboot.d, e.g. firstboot.d/01-firstaction.sh, firstboot.d/02-secondaction.sh run_remote_parts firstboot.d diff --git a/confluent_osdeploy/el8/profiles/default/scripts/post.sh b/confluent_osdeploy/el8/profiles/default/scripts/post.sh index 362a7945..f5e9bf84 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/post.sh @@ -47,5 +47,8 @@ run_remote_parts post.d # Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/ run_remote_config post.d +cd /root +fetch_remote confignet +cd - curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$confluent_mgr/confluent-api/self/updatestatus kill $logshowpid