diff --git a/confluent_osdeploy/el7/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el7/profiles/default/scripts/firstboot.sh index 9f073b80..b33a27b6 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el7/profiles/default/scripts/firstboot.sh @@ -9,19 +9,23 @@ nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') apikey=$(cat /etc/confluent/confluent.apikey) mgr=$(grep deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}') profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}') -cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt export nodename mgr profile . /etc/confluent/functions +if [ ! -f /etc/confluent/firstboot.ran ]; then + touch /etc/confluent/firstboot.ran -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 + cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt + 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 -# Induce execution of remote configuration, e.g. ansible plays in ansible/firstboot.d/ -run_remote_config firstboot + # Induce execution of remote configuration, e.g. ansible plays in ansible/firstboot.d/ + run_remote_config firstboot +fi curl -X POST -d 'status: complete' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus systemctl disable firstboot rm /etc/systemd/system/firstboot.service +rm /etc/confluent/firstboot.ran diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh index 9f073b80..b33a27b6 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -9,19 +9,23 @@ nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') apikey=$(cat /etc/confluent/confluent.apikey) mgr=$(grep deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}') profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}') -cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt export nodename mgr profile . /etc/confluent/functions +if [ ! -f /etc/confluent/firstboot.ran ]; then + touch /etc/confluent/firstboot.ran -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 + cat /etc/confluent/tls/*.pem >> /etc/pki/tls/certs/ca-bundle.crt + 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 -# Induce execution of remote configuration, e.g. ansible plays in ansible/firstboot.d/ -run_remote_config firstboot + # Induce execution of remote configuration, e.g. ansible plays in ansible/firstboot.d/ + run_remote_config firstboot +fi curl -X POST -d 'status: complete' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus systemctl disable firstboot rm /etc/systemd/system/firstboot.service +rm /etc/confluent/firstboot.ran