2020-06-01 14:52:38 +00:00
|
|
|
#!/bin/sh
|
2021-04-30 13:39:00 +00:00
|
|
|
mkdir -p /var/log/confluent
|
2021-12-08 12:42:19 +00:00
|
|
|
chmod 700 /var/log/confluent
|
2021-04-30 13:39:00 +00:00
|
|
|
exec >> /var/log/confluent/confluent-post.log
|
2021-05-03 12:57:59 +00:00
|
|
|
exec 2>> /var/log/confluent/confluent-post.log
|
2021-12-07 12:21:04 +00:00
|
|
|
chmod 600 /var/log/confluent/confluent-post.log
|
2021-04-30 13:39:00 +00:00
|
|
|
tail -f /var/log/confluent/confluent-post.log > /dev/tty &
|
2021-04-30 17:38:31 +00:00
|
|
|
logshowpid=$!
|
2020-06-01 14:52:38 +00:00
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
2020-07-01 18:20:40 +00:00
|
|
|
apikey=$(cat /etc/confluent/confluent.apikey)
|
|
|
|
|
|
|
|
chmod 700 /etc/confluent
|
|
|
|
chmod og-rwx /etc/confluent/*
|
2021-05-03 19:54:39 +00:00
|
|
|
export confluent_mgr confluent_profile nodename
|
2020-06-01 14:52:38 +00:00
|
|
|
. /etc/confluent/functions
|
|
|
|
|
2020-07-01 18:20:40 +00:00
|
|
|
|
2020-06-02 20:05:44 +00:00
|
|
|
if [ -f /tmp/cryptboot ]; then
|
|
|
|
run_remote tpm_luks.sh
|
|
|
|
fi
|
2020-08-06 20:37:18 +00:00
|
|
|
|
|
|
|
# By default, the install repository is ignored, change
|
|
|
|
# this by manually adding local repositories
|
|
|
|
|
2020-08-06 23:32:47 +00:00
|
|
|
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
|
2020-08-06 20:37:18 +00:00
|
|
|
run_remote_python add_local_repositories
|
2020-06-01 14:52:38 +00:00
|
|
|
# This script will execute in the installed system, but using the installer kernel prior to reboot.
|
|
|
|
# This is an appropriate place to run post install activities that do not require the actual installed
|
|
|
|
# kernel to run. For example adding drivers that would be needed for first boot to run cleanly.
|
|
|
|
# If, for example, there is a post script that has a dependency on a driver or filesystem that
|
|
|
|
# cannot work until booting into the installer, use firstboot.sh instead
|
|
|
|
|
2020-08-28 21:08:36 +00:00
|
|
|
# run_remote will download and execute from /var/lib/confluent/public/os/<profile>/scripts/ directory
|
2020-06-01 14:52:38 +00:00
|
|
|
# run_remote_python will use the appropriate python interpreter path to run the specified script
|
2020-07-24 14:59:15 +00:00
|
|
|
# A post.custom is provided to more conveniently hold customizations, see the post.custom file.
|
2020-06-01 14:52:38 +00:00
|
|
|
|
2021-03-29 18:03:11 +00:00
|
|
|
# This will induce server side processing of the syncfile contents if
|
|
|
|
# present
|
|
|
|
run_remote_python syncfileclient
|
|
|
|
|
2020-06-01 14:52:38 +00:00
|
|
|
# run_remote example.sh
|
|
|
|
# run_remote_python example.py
|
2020-07-24 14:59:15 +00:00
|
|
|
run_remote post.custom
|
2020-12-11 21:29:12 +00:00
|
|
|
|
|
|
|
# Also, scripts may be placed into 'post.d', e.g. post.d/01-runfirst.sh, post.d/02-runsecond.sh
|
2021-05-03 16:48:08 +00:00
|
|
|
run_remote_parts post.d
|
2021-03-18 18:12:19 +00:00
|
|
|
|
|
|
|
# Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/
|
2021-05-03 16:48:08 +00:00
|
|
|
run_remote_config post.d
|
2023-02-28 17:12:36 +00:00
|
|
|
cd /root
|
|
|
|
fetch_remote confignet
|
|
|
|
cd -
|
2021-05-03 16:48:08 +00:00
|
|
|
curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$confluent_mgr/confluent-api/self/updatestatus
|
2021-04-30 20:27:16 +00:00
|
|
|
kill $logshowpid
|