Adjust redeploy 79/36479/3
authorHarry Huang <huangxiangyu5@huawei.com>
Mon, 26 Jun 2017 04:22:59 +0000 (12:22 +0800)
committerJustin chi <chigang@huawei.com>
Sat, 15 Jul 2017 06:18:53 +0000 (06:18 +0000)
When deployment is interrupted (e.g. ctrl+c kill deploy.sh),
ansible processes in compass-tasks are still running. Redeploy
at this situation new ansible process will be affacted by
remained ones which cause errors.

Change-Id: I821445bd53397c7030145bf6dc925032cb42519c
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
deploy/compass_vm.sh

index 42fca80..971db05 100755 (executable)
@@ -93,6 +93,8 @@ function inject_compass_conf() {
 function refresh_compass_core () {
     sudo docker exec compass-deck bash -c "/opt/compass/bin/manage_db.py createdb"
     sudo docker exec compass-deck bash -c "/root/compass-deck/bin/clean_installers.py"
+    sudo docker exec compass-tasks bash -c \
+    "ps aux | grep -E '[a]nsible-playbook|[o]penstack-ansible' | awk '{print \$2}' | xargs kill -9"
     sudo rm -rf $WORK_DIR/docker/ansible/run/*
 }