diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh index 3fe06efc..a1c10d82 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -15,6 +15,8 @@ export nodename mgr profile 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 curl -X POST -d 'status: complete' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus diff --git a/confluent_osdeploy/el8/profiles/default/scripts/functions b/confluent_osdeploy/el8/profiles/default/scripts/functions index c299d30d..65407850 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/functions +++ b/confluent_osdeploy/el8/profiles/default/scripts/functions @@ -17,6 +17,13 @@ fetch_remote() { if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } +run_remote_parts() { + scriptlist=$(/usr/libexec/platform-python /etc/confluent/apiclient /confluent-api/self/scriptlist/$1|sed -e 's/^- //') + for script in $scriptlist; do + run_remote $1.d/$script + done +} + run_remote() { requestedcmd="'$*'" curlargs="" diff --git a/confluent_osdeploy/el8/profiles/default/scripts/post.sh b/confluent_osdeploy/el8/profiles/default/scripts/post.sh index 1ee0bcc8..0bac726b 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/post.sh @@ -33,3 +33,6 @@ run_remote_python add_local_repositories # run_remote example.sh # run_remote_python example.py run_remote post.custom + +# Also, scripts may be placed into 'post.d', e.g. post.d/01-runfirst.sh, post.d/02-runsecond.sh +run_remote_parts post