2021-05-21 21:07:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script is executed on each boot as it is
|
|
|
|
# completed. It is best to edit the middle of the file as
|
|
|
|
# noted below so custom commands are executed before
|
|
|
|
# the script notifies confluent that install is fully complete.
|
|
|
|
|
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
|
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
2022-11-08 14:45:08 +00:00
|
|
|
v4meth=$(grep ^ipv4_method: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
|
|
if [ "$v4meth" = "null" -o -z "$v4meth" ]; then
|
|
|
|
confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
|
|
fi
|
|
|
|
if [ -z "$confluent_mgr" ]; then
|
|
|
|
confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
|
|
fi
|
2021-05-21 21:07:32 +00:00
|
|
|
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
2022-08-24 20:09:05 +00:00
|
|
|
timedatectl set-timezone $(grep ^timezone: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
2021-05-21 21:07:32 +00:00
|
|
|
export nodename confluent_mgr confluent_profile
|
|
|
|
. /etc/confluent/functions
|
2021-05-24 20:20:54 +00:00
|
|
|
mkdir -p /var/log/confluent
|
2021-12-08 12:42:19 +00:00
|
|
|
chmod 700 /var/log/confluent
|
2021-05-21 21:07:32 +00:00
|
|
|
exec >> /var/log/confluent/confluent-onboot.log
|
|
|
|
exec 2>> /var/log/confluent/confluent-onboot.log
|
2021-12-07 12:21:04 +00:00
|
|
|
chmod 600 /var/log/confluent/confluent-onboot.log
|
2021-05-21 21:07:32 +00:00
|
|
|
tail -f /var/log/confluent/confluent-onboot.log > /dev/console &
|
|
|
|
logshowpid=$!
|
|
|
|
|
2022-04-13 13:50:39 +00:00
|
|
|
rpm --import /etc/pki/rpm-gpg/*
|
|
|
|
|
|
|
|
run_remote_python add_local_repositories
|
2021-07-23 20:23:15 +00:00
|
|
|
run_remote_python syncfileclient
|
2021-11-08 21:34:26 +00:00
|
|
|
run_remote_python confignet
|
2021-07-23 20:23:15 +00:00
|
|
|
|
2021-05-21 21:07:32 +00:00
|
|
|
run_remote onboot.custom
|
|
|
|
# onboot scripts may be placed into onboot.d, e.g. onboot.d/01-firstaction.sh, onboot.d/02-secondaction.sh
|
|
|
|
run_remote_parts onboot.d
|
|
|
|
|
|
|
|
# Induce execution of remote configuration, e.g. ansible plays in ansible/onboot.d/
|
|
|
|
run_remote_config onboot.d
|
|
|
|
|
|
|
|
#curl -X POST -d 'status: booted' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" https://$confluent_mgr/confluent-api/self/updatestatus
|
|
|
|
kill $logshowpid
|