aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorVladislav Belogrudov <vladislav.belogrudov@oracle.com>2015-09-04 19:47:54 +0300
committerVladislav Belogrudov <vladislav.belogrudov@oracle.com>2015-09-04 19:47:54 +0300
commit7f81dbc85bb98a943697c62f02d69ece07a1da22 (patch)
treea154c994b4e2d67ac0ca7f0b35678eaee072ed77 /ansible
parent11cba5fb66849f3a5ef0fd578b59d2ca12a0cdce (diff)
downloadkolla-7f81dbc85bb98a943697c62f02d69ece07a1da22.tar.gz
kolla-7f81dbc85bb98a943697c62f02d69ece07a1da22.zip
Check exit status of bootstrap containers
Currently bootstrap containers are waited to exit but are not checked for exit status and ansible runs further tasks. If bootstrapping fails we notice it at much later time. Change-Id: I137fc11b0f9d1f03d2ded08a213e8dbd62741f92 Closes-Bug: #1492337
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/cinder/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/glance/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/heat/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/keystone/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/neutron/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/nova/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/rabbitmq/tasks/bootstrap.yml5
7 files changed, 41 insertions, 0 deletions
diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml
index 8a4383fa6..0c6d8954f 100644
--- a/ansible/roles/cinder/tasks/bootstrap.yml
+++ b/ansible/roles/cinder/tasks/bootstrap.yml
@@ -71,8 +71,14 @@
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_cinder
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+ register: bootstrap_result
run_once: True
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Cinder bootstrap container
docker:
name: bootstrap_cinder
diff --git a/ansible/roles/glance/tasks/bootstrap.yml b/ansible/roles/glance/tasks/bootstrap.yml
index ae7e50128..e69d1c27d 100644
--- a/ansible/roles/glance/tasks/bootstrap.yml
+++ b/ansible/roles/glance/tasks/bootstrap.yml
@@ -70,9 +70,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_glance
+ register: bootstrap_result
run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Glance bootstrap container
docker:
name: bootstrap_glance
diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml
index 55ca525a1..ba79a360c 100644
--- a/ansible/roles/heat/tasks/bootstrap.yml
+++ b/ansible/roles/heat/tasks/bootstrap.yml
@@ -57,9 +57,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_heat
+ register: bootstrap_result
run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Heat boostrap container
docker:
name: bootstrap_heat
diff --git a/ansible/roles/keystone/tasks/bootstrap.yml b/ansible/roles/keystone/tasks/bootstrap.yml
index 78da1f2f7..5d58bdd50 100644
--- a/ansible/roles/keystone/tasks/bootstrap.yml
+++ b/ansible/roles/keystone/tasks/bootstrap.yml
@@ -60,9 +60,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for Keystone bootstrap container to exit
command: docker wait bootstrap_keystone
+ register: bootstrap_result
run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Keystone bootstrap container
docker:
name: bootstrap_keystone
diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml
index a422dfc82..c933e2432 100644
--- a/ansible/roles/neutron/tasks/bootstrap.yml
+++ b/ansible/roles/neutron/tasks/bootstrap.yml
@@ -52,9 +52,15 @@
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_neutron
+ register: bootstrap_result
run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Neutron bootstrap container
docker:
name: bootstrap_neutron
diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml
index 273772f2b..2a95cb028 100644
--- a/ansible/roles/nova/tasks/bootstrap.yml
+++ b/ansible/roles/nova/tasks/bootstrap.yml
@@ -51,9 +51,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_nova
+ register: bootstrap_result
run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ run_once: True
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up Nova bootstrap container
docker:
name: bootstrap_nova
diff --git a/ansible/roles/rabbitmq/tasks/bootstrap.yml b/ansible/roles/rabbitmq/tasks/bootstrap.yml
index 876015b1b..fc0d71940 100644
--- a/ansible/roles/rabbitmq/tasks/bootstrap.yml
+++ b/ansible/roles/rabbitmq/tasks/bootstrap.yml
@@ -48,8 +48,13 @@
- name: Waiting for bootstrap container
command: docker wait rabbitmq_bootstrap
+ register: bootstrap_result
when: exists.rc != 0
+- name: Checking for bootstrap failures
+ fail: msg="Bootstrapping failed"
+ when: bootstrap_result|changed and bootstrap_result.stdout != "0"
+
- name: Cleaning up bootstrap container
docker:
image: "{{ rabbitmq_image_full }}"