2020-05-19 16:22:46 +00:00
|
|
|
#!/bin/bash
|
2020-06-03 20:22:41 +00:00
|
|
|
deploycfg=/custom-installation/confluent/confluent.deploycfg
|
|
|
|
|
|
|
|
cryptboot=$(grep encryptboot: $deploycfg|sed -e 's/^encryptboot: //')
|
|
|
|
if [ "$cryptboot" != "" ] && [ "$cryptboot" != "none" ] && [ "$cryptboot" != "null" ]; then
|
|
|
|
echo "****Encrypted boot requested, but not implemented for this OS, halting install" > /dev/console
|
|
|
|
[ -f '/tmp/autoconsdev' ] && (echo "****Encryptod boot requested, but not implemented for this OS,halting install" >> $(cat /tmp/autoconsdev))
|
|
|
|
while :; do sleep 86400; done
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2020-05-19 16:22:46 +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
|
|
|
|
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
|
|
|
|
systemctl restart sshd
|
2020-06-03 15:26:34 +00:00
|
|
|
curl -f -X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/nodelist > /tmp/allnodes
|
2020-05-22 19:59:19 +00:00
|
|
|
curl -f https://$mgr/confluent-public/os/$profile/scripts/getinstalldisk > /custom-installation/getinstalldisk
|
2020-05-19 16:22:46 +00:00
|
|
|
python3 /custom-installation/getinstalldisk
|
|
|
|
sed -i s!%%INSTALLDISK%%!/dev/$(cat /tmp/installdisk)! /autoinstall.yaml
|