
Because of "If the default insecure keypair is used, Vagrant will automatically replace it with a randomly generated keypair on first vagrant up. [GH-2608]" it is necessary to rename the used SSH key because it will be overwritten at the moment. Change-Id: If9ee3860c93fe7b0c825ba8403ae3e25647266f3
15 lines
654 B
Bash
15 lines
654 B
Bash
#!/bin/sh
|
|
|
|
for node in $(sed -n '/<<< Packstack >>>/{:a;n;/>>> Packstack <<</b;p;ba}' /etc/hosts | awk '{ print $2 }'); do
|
|
ssh-keyscan $node >> /home/vagrant/.ssh/known_hosts
|
|
done
|
|
|
|
chown vagrant:vagrant /home/vagrant/.ssh/known_hosts
|
|
|
|
for node in $(sed -n '/<<< Packstack >>>/{:a;n;/>>> Packstack <<</b;p;ba}' /etc/hosts | awk '{ print $2 }'); do
|
|
ssh -i $HOME/.ssh/id_packstack $node "sudo mkdir -p /root/.ssh"
|
|
ssh -i $HOME/.ssh/id_packstack $node "sudo chmod 700 /root/.ssh"
|
|
ssh -i $HOME/.ssh/id_packstack $node "sudo cp /home/vagrant/.ssh/* /root/.ssh"
|
|
ssh -i $HOME/.ssh/id_packstack $node "sudo chown -R root:root /root/.ssh"
|
|
done
|