From ecfbd90af36439bcb51ec2cace0d0d2340e9fee1 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Mon, 29 May 2017 13:36:25 +0400 Subject: [mcp] Mend installation scripts * add/unify ssh options * get base image to temporary directory * specify os type for virt install * fix symbolic link to reclass * remove outdated fuel submodules Change-Id: I6833ce78c8fff97e1b89f4e92e6e6b470e9ce99f Signed-off-by: Michael Polenchuk --- .gitmodules | 62 ++---------------------------------- build/f_repos/sub/fuel-agent | 1 - build/f_repos/sub/fuel-astute | 1 - build/f_repos/sub/fuel-library | 1 - build/f_repos/sub/fuel-main | 1 - build/f_repos/sub/fuel-menu | 1 - build/f_repos/sub/fuel-nailgun-agent | 1 - build/f_repos/sub/fuel-ostf | 1 - build/f_repos/sub/fuel-ui | 1 - build/f_repos/sub/fuel-web | 1 - build/f_repos/sub/network-checker | 1 - build/f_repos/sub/python-fuelclient | 1 - build/f_repos/sub/shotgun | 1 - ci/deploy.sh | 4 +++ mcp/reclass/scripts/infra.sh | 13 +++----- mcp/reclass/scripts/openstack.sh | 2 +- mcp/reclass/scripts/salt.sh | 4 +-- 17 files changed, 13 insertions(+), 84 deletions(-) delete mode 160000 build/f_repos/sub/fuel-agent delete mode 160000 build/f_repos/sub/fuel-astute delete mode 160000 build/f_repos/sub/fuel-library delete mode 160000 build/f_repos/sub/fuel-main delete mode 160000 build/f_repos/sub/fuel-menu delete mode 160000 build/f_repos/sub/fuel-nailgun-agent delete mode 160000 build/f_repos/sub/fuel-ostf delete mode 160000 build/f_repos/sub/fuel-ui delete mode 160000 build/f_repos/sub/fuel-web delete mode 160000 build/f_repos/sub/network-checker delete mode 160000 build/f_repos/sub/python-fuelclient delete mode 160000 build/f_repos/sub/shotgun diff --git a/.gitmodules b/.gitmodules index 7a28aac6d..65eefe0b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,63 +1,5 @@ -[submodule "fuel-main"] - path = build/f_repos/sub/fuel-main - url = https://github.com/openstack/fuel-main.git - branch = stable/newton - ignore = all -[submodule "fuel-library"] - path = build/f_repos/sub/fuel-library - url = https://github.com/openstack/fuel-library.git - branch = stable/newton - ignore = all -[submodule "fuel-web"] - path = build/f_repos/sub/fuel-web - url = https://github.com/openstack/fuel-web.git - branch = stable/newton - ignore = all -[submodule "python-fuelclient"] - path = build/f_repos/sub/python-fuelclient - url = https://github.com/openstack/python-fuelclient.git - branch = stable/newton - ignore = all -[submodule "fuel-agent"] - path = build/f_repos/sub/fuel-agent - url = https://github.com/openstack/fuel-agent.git - branch = stable/newton - ignore = all -[submodule "fuel-nailgun-agent"] - path = build/f_repos/sub/fuel-nailgun-agent - url = https://github.com/openstack/fuel-nailgun-agent.git - branch = stable/newton - ignore = all -[submodule "fuel-astute"] - path = build/f_repos/sub/fuel-astute - url = https://github.com/openstack/fuel-astute.git - branch = stable/newton - ignore = all -[submodule "fuel-ostf"] - path = build/f_repos/sub/fuel-ostf - url = https://github.com/openstack/fuel-ostf.git - branch = stable/newton - ignore = all -[submodule "fuel-menu"] - path = build/f_repos/sub/fuel-menu - url = https://github.com/openstack/fuel-menu.git - branch = stable/newton - ignore = all -[submodule "shotgun"] - path = build/f_repos/sub/shotgun - url = https://github.com/openstack/shotgun.git - branch = stable/newton - ignore = all -[submodule "network-checker"] - path = build/f_repos/sub/network-checker - url = https://github.com/openstack/network-checker.git - branch = stable/newton - ignore = all -[submodule "fuel-ui"] - path = build/f_repos/sub/fuel-ui - url = https://github.com/openstack/fuel-ui.git - branch = stable/newton - ignore = all [submodule "mcp/reclass/classes/system"] path = mcp/reclass/classes/system url = https://github.com/Mirantis/reclass-system-salt-model + branch = master + ignore = all diff --git a/build/f_repos/sub/fuel-agent b/build/f_repos/sub/fuel-agent deleted file mode 160000 index 7d35078a9..000000000 --- a/build/f_repos/sub/fuel-agent +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7d35078a9d67a9015f49f5813dbad225837095a4 diff --git a/build/f_repos/sub/fuel-astute b/build/f_repos/sub/fuel-astute deleted file mode 160000 index 87ba44dcd..000000000 --- a/build/f_repos/sub/fuel-astute +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 87ba44dcde92a0bfe50fdba6e0a2f271e6859919 diff --git a/build/f_repos/sub/fuel-library b/build/f_repos/sub/fuel-library deleted file mode 160000 index 0281ca8ee..000000000 --- a/build/f_repos/sub/fuel-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0281ca8ee1900271252edc5e6e1ceb2112cfd0da diff --git a/build/f_repos/sub/fuel-main b/build/f_repos/sub/fuel-main deleted file mode 160000 index a0f955fc5..000000000 --- a/build/f_repos/sub/fuel-main +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a0f955fc5bff09c02d538ae2c9a7373b6ee511ed diff --git a/build/f_repos/sub/fuel-menu b/build/f_repos/sub/fuel-menu deleted file mode 160000 index 9aedc10ff..000000000 --- a/build/f_repos/sub/fuel-menu +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9aedc10ffea536d7d353cb5869c492a1729a98f2 diff --git a/build/f_repos/sub/fuel-nailgun-agent b/build/f_repos/sub/fuel-nailgun-agent deleted file mode 160000 index 0cfe06be9..000000000 --- a/build/f_repos/sub/fuel-nailgun-agent +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0cfe06be939f92c3a8158a0e8a96a7ab8cf5403b diff --git a/build/f_repos/sub/fuel-ostf b/build/f_repos/sub/fuel-ostf deleted file mode 160000 index 132f287fb..000000000 --- a/build/f_repos/sub/fuel-ostf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 132f287fb769276cde63ac283222d5447bc68308 diff --git a/build/f_repos/sub/fuel-ui b/build/f_repos/sub/fuel-ui deleted file mode 160000 index 5b66f907e..000000000 --- a/build/f_repos/sub/fuel-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b66f907e628ba16d03a3fd3f259099b727a5fa2 diff --git a/build/f_repos/sub/fuel-web b/build/f_repos/sub/fuel-web deleted file mode 160000 index d04c1108b..000000000 --- a/build/f_repos/sub/fuel-web +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d04c1108b2b19e5d681a07fd3492b93d133c4617 diff --git a/build/f_repos/sub/network-checker b/build/f_repos/sub/network-checker deleted file mode 160000 index 5efbc91a1..000000000 --- a/build/f_repos/sub/network-checker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5efbc91a120ae3dc12e8751ba4bdf2644590939c diff --git a/build/f_repos/sub/python-fuelclient b/build/f_repos/sub/python-fuelclient deleted file mode 160000 index 8ac48ac48..000000000 --- a/build/f_repos/sub/python-fuelclient +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8ac48ac48facc47923ba00c09bf96080ca88d31c diff --git a/build/f_repos/sub/shotgun b/build/f_repos/sub/shotgun deleted file mode 160000 index 43b5d6d90..000000000 --- a/build/f_repos/sub/shotgun +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 43b5d6d905b1179fd36fa26255d58dc0113b388d diff --git a/ci/deploy.sh b/ci/deploy.sh index bdcd15d99..b6926a7cf 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -240,6 +240,10 @@ pushd ${DEPLOY_DIR} > /dev/null # Prepare the deploy config files based on lab/pod information, deployment # scenario, etc. +export SSH_KEY=mcp.rsa +export SALT_MASTER=192.168.10.100 +export SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${SSH_KEY}" + ./infra.sh ./salt.sh ./openstack.sh diff --git a/mcp/reclass/scripts/infra.sh b/mcp/reclass/scripts/infra.sh index 7f5c210db..b83f21508 100755 --- a/mcp/reclass/scripts/infra.sh +++ b/mcp/reclass/scripts/infra.sh @@ -1,7 +1,5 @@ #!/bin/bash -SSH_KEY=mcp.rsa -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 ) @@ -13,7 +11,7 @@ apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm # get base image mkdir -p images -wget -nc $BASE_IMAGE +wget -P /tmp -nc $BASE_IMAGE for node in "${!NODES[@]}"; do # clean up existing nodes @@ -24,7 +22,7 @@ for node in "${!NODES[@]}"; do # create/prepare images [ -f images/mcp_${node}.iso ] || ./create-config-drive.sh -k ${SSH_KEY}.pub -u user-data.sh -h ${node} images/mcp_${node}.iso - cp ${BASE_IMAGE/*\/} images/mcp_${node}.qcow2 + cp /tmp/${BASE_IMAGE/*\/} images/mcp_${node}.qcow2 qemu-img resize images/mcp_${node}.qcow2 100G done @@ -47,6 +45,7 @@ for node in "${!NODES[@]}"; do --network network:internal,model=virtio \ --network network:public,model=virtio \ --disk path=$(pwd)/images/mcp_${node}.qcow2,format=qcow2,bus=virtio,cache=none,io=native \ + --os-type linux --os-variant none \ --boot hd --vnc --console pty --autostart --noreboot \ --disk path=$(pwd)/images/mcp_${node}.iso,device=cdrom done @@ -64,20 +63,16 @@ 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 while (($ATTEMPT <= $CONNECTION_ATTEMPTS)); do - ssh -i ${SSH_KEY} ubuntu@$SALT_MASTER uptime + ssh $SSH_OPTS ubuntu@$SALT_MASTER uptime case $? in (0) echo "${ATTEMPT}> Success"; break ;; (*) 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/openstack.sh b/mcp/reclass/scripts/openstack.sh index b757e8ecf..3f6b0617c 100755 --- a/mcp/reclass/scripts/openstack.sh +++ b/mcp/reclass/scripts/openstack.sh @@ -3,7 +3,7 @@ # Deploy Openstack # -ssh -i mcp.rsa ubuntu@192.168.10.100 bash -s << OPENSTACK_INSTALL_END +ssh $SSH_OPTS ubuntu@$SALT_MASTER bash -s << OPENSTACK_INSTALL_END sudo -i salt-call state.apply salt diff --git a/mcp/reclass/scripts/salt.sh b/mcp/reclass/scripts/salt.sh index 6495bbce2..6c60c5662 100755 --- a/mcp/reclass/scripts/salt.sh +++ b/mcp/reclass/scripts/salt.sh @@ -4,7 +4,7 @@ # # ssh to cfg01 -ssh -i mcp.rsa ubuntu@192.168.10.100 bash -s << SALT_INSTALL_END +ssh $SSH_OPTS ubuntu@$SALT_MASTER bash -s << SALT_INSTALL_END sudo -i apt-get update @@ -12,7 +12,7 @@ ssh -i mcp.rsa ubuntu@192.168.10.100 bash -s << SALT_INSTALL_END svn export --force https://github.com/salt-formulas/salt-formulas/trunk/deploy/scripts /srv/salt/scripts git clone --depth=1 --recurse-submodules https://git.opnfv.org/fuel - ln -s $(pwd)/fuel/mcp/reclass /srv/salt/reclass + ln -s /root/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