2020-05-01 20:41:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
echo "Confluent first boot is running"
|
|
|
|
cp -a /etc/confluent/ssh/* /etc/ssh/
|
|
|
|
systemctl restart sshd
|
|
|
|
rootpw=$(grep ^rootpassword: /etc/confluent/confluent.deploycfg |awk '{print $2}')
|
|
|
|
if [ ! -z "$rootpw" -a "$rootpw" != "null" ]; then
|
|
|
|
echo root:$rootpw | chpasswd -e
|
|
|
|
fi
|
2020-05-19 17:36:49 +00:00
|
|
|
nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
|
|
|
|
apikey=$(cat /etc/confluent/confluent.apikey)
|
|
|
|
mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg |awk '{print $2}')
|
2020-05-01 20:41:01 +00:00
|
|
|
hostnamectl set-hostname $(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
|
2020-05-02 15:55:37 +00:00
|
|
|
touch /etc/cloud/cloud-init.disabled
|
2020-05-19 21:38:25 +00:00
|
|
|
curl --capath /etc/confluent/tls -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" -X POST -d "status: complete" https://$mgr/confluent-api/self/updatestatus
|