2021-05-03 14:50:04 -04:00
|
|
|
#!/bin/bash
|
2020-05-14 14:49:53 -04:00
|
|
|
|
|
|
|
# This script runs at the end of the final boot, updating status
|
2021-05-03 14:50:04 -04:00
|
|
|
exec >> /var/log/confluent/confluent-firstboot.log
|
|
|
|
exec 2>> /var/log/confluent/confluent-firstboot.log
|
2020-05-14 14:49:53 -04:00
|
|
|
|
2020-05-14 13:36:23 -04:00
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
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/^rootpassword: //')
|
2020-05-14 13:36:23 -04:00
|
|
|
proto=$(grep ^protocol: /etc/confluent/confluent.deploycfg |awk '{print $2}')
|
2021-05-03 12:48:08 -04:00
|
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
2020-06-01 16:01:26 -04:00
|
|
|
. /etc/confluent/functions
|
|
|
|
|
2020-10-16 11:34:43 -04:00
|
|
|
run_remote firstboot.custom
|
2021-03-18 14:37:54 -04:00
|
|
|
|
|
|
|
# Firstboot scripts may be placed into firstboot.d, e.g. firstboot.d/01-firstaction.sh, firstboot.d/02-secondaction.sh
|
2021-05-03 12:48:08 -04:00
|
|
|
run_remote_parts firstboot.d
|
2021-03-18 14:37:54 -04:00
|
|
|
|
|
|
|
# Induce execution of remote configuration, e.g. ansible plays in ansible/firstboot.d/
|
2021-05-03 12:48:08 -04:00
|
|
|
run_remote_config firstboot.d
|
2021-03-18 14:37:54 -04:00
|
|
|
|
2021-05-03 12:48:08 -04:00
|
|
|
curl --capath /etc/confluent/tls -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" -f -X POST -d "status: complete" https://$confluent_mgr/confluent-api/self/updatestatus
|