diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml index 8a4383fa6c..0c6d8954f6 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 ae7e50128f..e69d1c27d6 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 55ca525a1f..ba79a360c5 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 78da1f2f7c..5d58bdd502 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 a422dfc82e..c933e24322 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 273772f2bc..2a95cb0283 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 876015b1bd..fc0d719403 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 }}"