Fix bug the controller node when baremetal deploy 47/37047/3
authorwutianwei <wutianwei1@huawei.com>
Fri, 7 Jul 2017 04:09:27 +0000 (12:09 +0800)
committerwutianwei <wutianwei1@huawei.com>
Wed, 12 Jul 2017 04:14:23 +0000 (12:14 +0800)
We need to flush the handle to restart network,
before checking network.

improve the message when failed

Change-Id: If38198c62b4bf81d38b294264db30514998fe086
Signed-off-by: wutianwei <wutianwei1@huawei.com>
deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml
deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml
deploy/adapters/ansible/roles/setup-infrastructure/vars/main.yml [new file with mode: 0644]
deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml

index c878ab7..e3b467c 100644 (file)
@@ -14,6 +14,8 @@
   notify:
     - restart network service
 
+- meta: flush_handlers
+
 - name: check apt source
   shell: "ping -c 2 {{LOCAL_REPOSITORY_IP}} > /dev/null"
   register: checkresult
index 5b70aee..478c4d4 100644 (file)
@@ -19,8 +19,9 @@
   register: setup_infrastructure_result
 
 - fail:
-    msg: "there are some task failed when setup host."
-  when: setup_infrastructure_result.stdout.find('failed=1') != -1
+    msg: "there are some task failed when setup infrastructure."
+  when: setup_infrastructure_result.stdout.find('failed={{item}}') != -1
+  with_sequence: start=1 end={{ max_failed_times }} stride=1
 
 - fail:
     msg: "some host are unreachable."
diff --git a/deploy/adapters/ansible/roles/setup-infrastructure/vars/main.yml b/deploy/adapters/ansible/roles/setup-infrastructure/vars/main.yml
new file mode 100644 (file)
index 0000000..22a990e
--- /dev/null
@@ -0,0 +1,2 @@
+---
+max_failed_times: 9
index e577024..b71612f 100644 (file)
@@ -19,7 +19,7 @@
   register: setup_openstack_result
 
 - fail:
-    msg: "some task failed when setup host."
+    msg: "some task failed when setup openstack."
   when: setup_openstack_result.stdout.find('failed=1') != -1
 
 - fail: