summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xci/03-maasdeploy.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index 58879df4..d2dde1d4 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -345,10 +345,12 @@ addnodes(){
# if we have a virshurl configuration we use it, else we use local
VIRSHURL=$(cat labconfig.json | jq -r '.opnfv.virshurl')
if ([ $VIRSHURL == "" ] || [ "$VIRSHURL" == "null" ]); then
- VIRSHURL="qemu+ssh://$USER@$MAAS_IP/system "
+ VIRSHIP=$MAAS_IP
+ VIRSHURL="qemu+ssh://$USER@$VIRSHIP/system "
VIRSHHOST=""
else
VIRSHHOST=$(echo $VIRSHURL| cut -d\/ -f 3 | cut -d@ -f2)
+ VIRSHIP="" # TODO: parse from $VIRSHURL if needed
fi
if [ "$virtinstall" -eq 1 ]; then
@@ -374,6 +376,16 @@ addnodes(){
done
fi
+ # Add server fingerprint to known hosts to prevent security prompt in the
+ # SSH connection during the virt-install
+ if [ $VIRSHIP != "" ]; then
+ # Check if the IP is not already present among the known hosts
+ if ! ssh-keygen -F $VIRSHIP > /dev/null ; then
+ echo "SSH fingerprint of the host is not known yet, adding"
+ ssh-keyscan -H $VIRSHIP >> ~/.ssh/known_hosts
+ fi
+ fi
+
virt-install --connect $VIRSHURL --name bootstrap --ram 4098 --cpu host --vcpus 2 --video \
cirrus --arch x86_64 --disk size=20,format=qcow2,bus=virtio,cache=directsync,io=native,pool=default \
$netw --boot network,hd,menu=off --noautoconsole \