summaryrefslogtreecommitdiffstats
path: root/deploy/adapters
diff options
context:
space:
mode:
authorwutianwei <wutianwei1@huawei.com>2017-07-07 12:09:27 +0800
committerwutianwei <wutianwei1@huawei.com>2017-07-12 12:14:23 +0800
commitbf14a70c09be362b13b16054174c16e43da9e2d2 (patch)
tree451e9447be1b2bf97d29a37536daf26577d27f97 /deploy/adapters
parent191324087c0fc0524f8566de8eeec3e35e34dcca (diff)
Fix bug the controller node when baremetal deploy
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>
Diffstat (limited to 'deploy/adapters')
-rw-r--r--deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml2
-rw-r--r--deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml5
-rw-r--r--deploy/adapters/ansible/roles/setup-infrastructure/vars/main.yml2
-rw-r--r--deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml2
4 files changed, 8 insertions, 3 deletions
diff --git a/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml
index c878ab7f..e3b467cf 100644
--- a/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml
+++ b/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml
@@ -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
diff --git a/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml b/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml
index 5b70aeef..478c4d48 100644
--- a/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml
@@ -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
index 00000000..22a990ef
--- /dev/null
+++ b/deploy/adapters/ansible/roles/setup-infrastructure/vars/main.yml
@@ -0,0 +1,2 @@
+---
+max_failed_times: 9
diff --git a/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml
index e5770245..b71612f7 100644
--- a/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml
@@ -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: