From f85c84133c2f8d6aec3c707cfb92cb03db543bd6 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Fri, 26 May 2017 12:12:15 +0400 Subject: [mcp] Replace reclass system models with submodule Change-Id: Id693f7b0f3542d605b0f71601f3bd21eb882c7ba Signed-off-by: Michael Polenchuk --- mcp/reclass/scripts/infra.sh | 8 ++++++++ mcp/reclass/scripts/salt.sh | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'mcp/reclass/scripts') diff --git a/mcp/reclass/scripts/infra.sh b/mcp/reclass/scripts/infra.sh index 182d90692..7f5c210db 100755 --- a/mcp/reclass/scripts/infra.sh +++ b/mcp/reclass/scripts/infra.sh @@ -5,6 +5,10 @@ SALT_MASTER=192.168.10.100 BASE_IMAGE=https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img declare -A NODES=( [cfg01]=4096 [ctl01]=6144 [ctl02]=6144 [ctl03]=6144 [gtw01]=2048 [cmp01]=2048 ) +# get required packages +apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm + +# generate ssh key [ -f $SSH_KEY ] || ssh-keygen -f $SSH_KEY -N '' # get base image @@ -60,6 +64,9 @@ done CONNECTION_ATTEMPTS=20 SLEEP=15 +# refresh salt master host key +ssh-keygen -R $SALT_MASTER + # wait until ssh on Salt master is available echo "Attempting to ssh to Salt master ..." ATTEMPT=1 @@ -71,5 +78,6 @@ while (($ATTEMPT <= $CONNECTION_ATTEMPTS)); do (*) echo "${ATTEMPT}/${CONNECTION_ATTEMPTS}> ssh server ain't ready yet, waiting for ${SLEEP} seconds ..." ;; esac sleep $SLEEP + ssh-keyscan -t ecdsa $SALT_MASTER >> ~/.ssh/known_hosts ((ATTEMPT+=1)) done diff --git a/mcp/reclass/scripts/salt.sh b/mcp/reclass/scripts/salt.sh index c202ab574..6495bbce2 100755 --- a/mcp/reclass/scripts/salt.sh +++ b/mcp/reclass/scripts/salt.sh @@ -11,8 +11,8 @@ ssh -i mcp.rsa ubuntu@192.168.10.100 bash -s << SALT_INSTALL_END apt-get install -y git curl subversion svn export --force https://github.com/salt-formulas/salt-formulas/trunk/deploy/scripts /srv/salt/scripts - git clone --depth=1 https://git.opnfv.org/fuel - ln -s fuel/mcp/reclass /srv/salt/reclass + git clone --depth=1 --recurse-submodules https://git.opnfv.org/fuel + ln -s $(pwd)/fuel/mcp/reclass /srv/salt/reclass cd /srv/salt/scripts MASTER_HOSTNAME=cfg01.virtual-mcp-ocata-ovs.local ./salt-master-init.sh -- cgit 1.2.3-korg