2020-06-01 20:01:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script runs when install is finished, but while the installer
|
|
|
|
# is still running, with the to-be-booted system mounted in /mnt
|
|
|
|
|
|
|
|
# carry over deployment configuration and api key for OS install action
|
2021-05-03 16:48:08 +00:00
|
|
|
confluent_mgr=$(grep ^deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
|
|
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|sed -e 's/^profile: //')
|
2020-07-01 12:57:08 +00:00
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
2021-05-03 19:54:39 +00:00
|
|
|
export confluent_mgr confluent_profile nodename
|
2020-06-01 20:01:26 +00:00
|
|
|
mkdir -p /mnt/etc/confluent
|
|
|
|
chmod 700 /mnt/etc/confluent
|
|
|
|
cp /tmp/functions /mnt/etc/confluent/
|
|
|
|
. /tmp/functions
|
2020-07-01 15:38:33 +00:00
|
|
|
cp -a /etc/confluent/* /mnt/etc/confluent/
|
2020-06-01 20:01:26 +00:00
|
|
|
cp -a /tls /mnt/etc/confluent/
|
|
|
|
cp -a /tls/* /mnt/var/lib/ca-certificates/openssl
|
|
|
|
cp -a /tls/* /mnt/var/lib/ca-certificates/pem
|
|
|
|
cp -a /tls/*.pem /mnt/etc/pki/trust/anchors
|
2021-03-19 20:07:59 +00:00
|
|
|
cat /tls/*.pem > /mnt/etc/confluent/ca.pem
|
|
|
|
cp /opt/confluent/bin/apiclient /mnt/etc/confluent
|
2020-06-01 20:01:26 +00:00
|
|
|
|
|
|
|
run_remote setupssh.sh
|
2021-03-19 19:13:37 +00:00
|
|
|
|
|
|
|
echo Port 22 >> /etc/ssh/sshd_config
|
|
|
|
echo Port 2222 >> /etc/ssh/sshd_config
|
|
|
|
echo Match LocalPort 22 >> /etc/ssh/sshd_config
|
|
|
|
echo " ChrootDirectory /mnt" >> /etc/ssh/sshd_config
|
|
|
|
kill -HUP $(cat /run/sshd.pid)
|
2021-05-03 18:50:04 +00:00
|
|
|
mkdir -p /mnt/var/log/confluent
|
|
|
|
cp /tmp/confluent*log /mnt/var/log/confluent
|
2021-03-19 19:13:37 +00:00
|
|
|
|