initial cluster-config postinstall step

This commit is contained in:
Starbeamrainbowlabs 2021-11-26 00:48:42 +00:00
parent 629109357d
commit 5f0cbcd427
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
task_begin "Configuring ssh";
while read -r username; do
sudo -u "${username}" bash -c 'ssh -T git@git.starbeamrainbowlabs.com || ssh-keyscan -H git.starbeamrainbowlabs.com >>$HOME/.ssh/known_hosts';
done < <(find /home -mindepth 1 -maxdepth 1 -type d);
ssh -T git@git.starbeamrainbowlabs.com || ssh-keyscan -H git.starbeamrainbowlabs.com >>/root/.ssh/known_hosts
task_end "$?";
task_begin "Cloning /etc/cluster-config";
if [[ -d /etc/cluster-config ]]; then
cd "/etc/cluster-config" || { echo "Failed to cd into /etc/cluster-config even though it seems to exist"; exit 1; };
git pull;
else
git clone git@git.starbeamrainbowlabs.com:sbrl/cluster-config.git /etc/cluster-config;
fi
task_end "$?";