2020-04-30 21:28:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
deploycfg=/custom-installation/confluent/confluent.deploycfg
|
2020-05-15 20:06:57 +00:00
|
|
|
mgr=$(grep ^deploy_server $deploycfg|awk '{print $2}')
|
2020-04-30 21:28:40 +00:00
|
|
|
cat /custom-installation/ssh/*.rootpubkey > /root/.ssh/authorized_keys
|
|
|
|
nodename=$(grep ^NODENAME: /custom-installation/confluent/confluent.info|awk '{print $2}')
|
|
|
|
apikey=$(cat /custom-installation/confluent/confluent.apikey)
|
|
|
|
for pubkey in /etc/ssh/ssh_host*key.pub; do
|
|
|
|
certfile=${pubkey/.pub/-cert.pub}
|
|
|
|
keyfile=${pubkey%.pub}
|
|
|
|
curl -f -X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" -d @$pubkey https://$mgr/confluent-api/self/sshcert > $certfile
|
|
|
|
echo HostKey $keyfile >> /etc/ssh/sshd_config.d/confluent.conf
|
|
|
|
echo HostCertificate $certfile >> /etc/ssh/sshd_config.d/confluent.conf
|
|
|
|
done
|
2020-05-02 14:58:06 +00:00
|
|
|
echo HostbasedAuthentication yes >> /etc/ssh/sshd_config.d/confluent.conf
|
|
|
|
echo HostbasedUsesNameFromPacketOnly yes >> /etc/ssh/sshd_config.d/confluent.conf
|
|
|
|
echo IgnoreRhosts no >> /etc/ssh/sshd_config.d/confluent.conf
|
2020-04-30 21:28:40 +00:00
|
|
|
systemctl restart sshd
|
2020-05-02 14:58:06 +00:00
|
|
|
curl -f X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/nodelist > /tmp/allnodes
|
2020-05-02 02:04:32 +00:00
|
|
|
curl https://$mgr/confluent-public/confluent/util/getinstalldisk > /custom-installation/getinstalldisk
|
|
|
|
python3 /custom-installation/getinstalldisk
|
|
|
|
sed -i s!%%INSTALLDISK%%!/dev/$(cat /tmp/installdisk)! /autoinstall.yaml
|