2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-03 18:14:43 +00:00
confluent/misc/ubuntu20.04deploy/custom-installation/pre.sh
Jarrod Johnson b3b68774ab Add prototype ubuntu initrd additions
This sets the stage for Ubuntu deployment
2020-04-30 17:28:40 -04:00

16 lines
792 B
Bash
Executable File

#!/bin/bash
deploycfg=/custom-installation/confluent/confluent.deploycfg
mgr=$(grep ^ipv4_server $deploycfg|awk '{print $2}')
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
systemctl restart sshd
sleep 86400