2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00

Add directory based post/firstboot capability

el8 profiles gain post.d/firstboot.d capability
This commit is contained in:
Jarrod Johnson 2020-12-11 16:29:12 -05:00
parent 47f04c8462
commit 0afa4c217c
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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=""

View File

@ -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