initial cluster-config postinstall step
This commit is contained in:
parent
629109357d
commit
5f0cbcd427
1 changed files with 23 additions and 0 deletions
23
src/steps-postinstall/100-ssh-cluster-config.sh
Executable file
23
src/steps-postinstall/100-ssh-cluster-config.sh
Executable 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 "$?";
|
Loading…
Reference in a new issue