From 040e68b1ae46004ab832e40bb9d46ed27751b96f Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Fri, 9 Oct 2015 09:39:02 -0400 Subject: Variablize the ssh options for easier maintenance Change-Id: I17a7bef84af194063f748773131dd3b8dc7c72dc Signed-off-by: Dan Radez --- build/instack.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/build/instack.sh b/build/instack.sh index 22bd7831..a00d9ee7 100755 --- a/build/instack.sh +++ b/build/instack.sh @@ -27,7 +27,7 @@ if ! sudo grep "$(cat ~/.ssh/id_rsa.pub)" /home/stack/.ssh/authorized_keys; then fi # clean up stack user previously build instack disk images -ssh -T -o "StrictHostKeyChecking no" stack@localhost "rm -f instack*.qcow2" +ssh -T ${SSH_OPTIONS[@]} stack@localhost "rm -f instack*.qcow2" # Yum repo setup for building the undercloud if ! rpm -q epel-release > /dev/null; then @@ -69,7 +69,7 @@ fi # ensure that no previous undercloud VMs are running # and rebuild the bare undercloud VMs -ssh -T -o "StrictHostKeyChecking no" stack@localhost < /dev/null || echo -n '' virsh undefine instack --remove-all-storage 2> /dev/null || echo -n '' @@ -97,7 +97,7 @@ UNDERCLOUD=$(grep instack /var/lib/libvirt/dnsmasq/default.leases | awk '{print # ensure that we can ssh to the undercloud CNT=10 -while ! ssh -T -o "StrictHostKeyChecking no" "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do +while ! ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do echo -n "." sleep 3 CNT=CNT-1 @@ -105,7 +105,7 @@ done # TODO fail if CNT=0 # yum repo, triple-o package and ssh key setup for the undercloud -ssh -T -o "StrictHostKeyChecking no" "root@$UNDERCLOUD" < /dev/null; then yum install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm @@ -122,11 +122,11 @@ chown stack:stack /home/stack/.ssh/authorized_keys EOI # install undercloud on Undercloud VM -ssh -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" "openstack undercloud install" +ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install" # make a copy of instack VM's definitions, and disk image # it must be stopped to make a copy of its disk image -ssh -T -o "StrictHostKeyChecking no" stack@localhost < /dev/null && [ $CNT -gt 0 ]; do CNT=CNT-1 done CNT=10 -while ! ssh -T -o "StrictHostKeyChecking no" "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do +while ! ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do echo -n "." sleep 3 CNT=CNT-1 @@ -179,12 +179,12 @@ done # inject the already downloaded cloud image so it's not downloaded again echo "Copying CentOS Cache to instack VM" -ssh -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" "mkdir .cache" -ssh -T -o "StrictHostKeyChecking no" stack@localhost "scp -r -o 'StrictHostKeyChecking no' /home/stack/.cache/image-create/CentOS-7-x86_64-GenericCloud* \"stack@$UNDERCLOUD\":.cache/" +ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "mkdir .cache" +ssh -T ${SSH_OPTIONS[@]} stack@localhost "scp -r ${SSH_OPTIONS[@]} /home/stack/.cache/image-create/CentOS-7-x86_64-GenericCloud* \"stack@$UNDERCLOUD\":.cache/" # build the overcloud images echo "Building overcloud images" -ssh -T -o "StrictHostKeyChecking no" "stack@$UNDERCLOUD" < /dev/null || echo -n '' virsh undefine instack --remove-all-storage 2> /dev/null || echo -n '' -- cgit 1.2.3-korg