2021-05-03 14:50:04 -04:00
|
|
|
#!/bin/bash
|
2020-05-14 13:36:23 -04:00
|
|
|
|
2020-06-01 16:01:26 -04:00
|
|
|
# This script runs at the end of install in the installed system
|
|
|
|
# but still under the installer kernel.
|
2020-05-14 13:36:23 -04:00
|
|
|
|
2020-06-01 16:01:26 -04: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 13:36:23 -04:00
|
|
|
|
2020-06-01 16:01:26 -04:00
|
|
|
# If there are dependencies on the kernel (drivers or special filesystems)
|
|
|
|
# then firstboot.sh would be the script to customize.
|
2020-05-14 13:36:23 -04:00
|
|
|
|
2021-12-08 07:42:19 -05:00
|
|
|
chmod 700 /var/log/confluent
|
2021-05-03 14:50:04 -04:00
|
|
|
exec >> /var/log/confluent/confluent-post.log
|
|
|
|
exec 2>> /var/log/confluent/confluent-post.log
|
2021-12-07 07:21:04 -05:00
|
|
|
chmod 600 /var/log/confluent/confluent-post.log
|
2021-05-03 12:48:08 -04: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 16:01:26 -04:00
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
2021-05-03 12:48:08 -04:00
|
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
2020-07-01 14:20:40 -04:00
|
|
|
|
|
|
|
chmod 700 /etc/confluent
|
|
|
|
chmod og-rwx /etc/confluent/*
|
|
|
|
|
|
|
|
|
2021-05-03 15:54:39 -04:00
|
|
|
export confluent_mgr confluent_profile nodename
|
2020-07-01 09:52:17 -04:00
|
|
|
. /etc/confluent/functions
|
2020-05-14 13:36:23 -04:00
|
|
|
|
2021-03-29 14:03:11 -04:00
|
|
|
# This will induce server side processing of the syncfile contents if
|
|
|
|
# present
|
|
|
|
run_remote_python syncfileclient
|
|
|
|
|
2020-10-16 11:34:43 -04:00
|
|
|
run_remote post.custom
|
2020-07-01 14:20:40 -04:00
|
|
|
|
2021-03-18 14:37:54 -04:00
|
|
|
# Also, scripts may be placed into 'post.d', e.g. post.d/01-runfirst.sh, post.d/02-runsecond.sh
|
2021-05-03 12:48:08 -04:00
|
|
|
run_remote_parts post.d
|
2021-03-18 14:37:54 -04:00
|
|
|
|
|
|
|
# Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/
|
2021-05-03 12:48:08 -04:00
|
|
|
run_remote_config post.d
|
2021-03-18 14:37:54 -04:00
|
|
|
|
2021-05-03 12:48:08 -04: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 13:36:23 -04:00
|
|
|
|