2021-05-03 18:50:04 +00:00
|
|
|
#!/bin/bash
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2020-06-01 20:01:26 +00:00
|
|
|
# This script runs at the end of install in the installed system
|
|
|
|
# but still under the installer kernel.
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2020-06-01 20:01:26 +00:00
|
|
|
# This is a good place to run most customizations that do not have any
|
|
|
|
# dependency upon the install target kernel being active.
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2020-06-01 20:01:26 +00:00
|
|
|
# If there are dependencies on the kernel (drivers or special filesystems)
|
|
|
|
# then firstboot.sh would be the script to customize.
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2021-05-03 18:50:04 +00:00
|
|
|
exec >> /var/log/confluent/confluent-post.log
|
|
|
|
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-05-03 16:48:08 +00:00
|
|
|
confluent_mgr=$(grep ^deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
|
|
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|sed -e 's/^profile: //')
|
2020-06-01 20:01:26 +00:00
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
2021-05-03 16:48:08 +00:00
|
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
2020-07-01 18:20:40 +00:00
|
|
|
|
|
|
|
chmod 700 /etc/confluent
|
|
|
|
chmod og-rwx /etc/confluent/*
|
|
|
|
|
|
|
|
|
2021-05-03 19:54:39 +00:00
|
|
|
export confluent_mgr confluent_profile nodename
|
2020-07-01 13:52:17 +00:00
|
|
|
. /etc/confluent/functions
|
2020-05-14 17:36:23 +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-10-16 15:34:43 +00:00
|
|
|
run_remote post.custom
|
2020-07-01 18:20:40 +00:00
|
|
|
|
2021-03-18 18:37:54 +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:37:54 +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
|
2021-03-18 18:37:54 +00:00
|
|
|
|
2021-05-03 16:48:08 +00:00
|
|
|
curl -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" https://$confluent_mgr/confluent-api/self/updatestatus
|
2020-05-14 17:36:23 +00:00
|
|
|
|