Skip to content
Snippets Groups Projects
Commit 7f81dbc8 authored by Vladislav Belogrudov's avatar Vladislav Belogrudov
Browse files

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
parent 11cba5fb
No related branches found
No related tags found
No related merge requests found
...@@ -71,8 +71,14 @@ ...@@ -71,8 +71,14 @@
- name: Waiting for bootstrap container to exit - name: Waiting for bootstrap container to exit
command: docker wait bootstrap_cinder command: docker wait bootstrap_cinder
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
register: bootstrap_result
run_once: True 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 - name: Cleaning up Cinder bootstrap container
docker: docker:
name: bootstrap_cinder name: bootstrap_cinder
......
...@@ -70,9 +70,15 @@ ...@@ -70,9 +70,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031 # https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit - name: Waiting for bootstrap container to exit
command: docker wait bootstrap_glance command: docker wait bootstrap_glance
register: bootstrap_result
run_once: True run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed 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 - name: Cleaning up Glance bootstrap container
docker: docker:
name: bootstrap_glance name: bootstrap_glance
......
...@@ -57,9 +57,15 @@ ...@@ -57,9 +57,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031 # https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit - name: Waiting for bootstrap container to exit
command: docker wait bootstrap_heat command: docker wait bootstrap_heat
register: bootstrap_result
run_once: True run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed 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 - name: Cleaning up Heat boostrap container
docker: docker:
name: bootstrap_heat name: bootstrap_heat
......
...@@ -60,9 +60,15 @@ ...@@ -60,9 +60,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031 # https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for Keystone bootstrap container to exit - name: Waiting for Keystone bootstrap container to exit
command: docker wait bootstrap_keystone command: docker wait bootstrap_keystone
register: bootstrap_result
run_once: True run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed 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 - name: Cleaning up Keystone bootstrap container
docker: docker:
name: bootstrap_keystone name: bootstrap_keystone
......
...@@ -52,9 +52,15 @@ ...@@ -52,9 +52,15 @@
- name: Waiting for bootstrap container to exit - name: Waiting for bootstrap container to exit
command: docker wait bootstrap_neutron command: docker wait bootstrap_neutron
register: bootstrap_result
run_once: True run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed 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 - name: Cleaning up Neutron bootstrap container
docker: docker:
name: bootstrap_neutron name: bootstrap_neutron
......
...@@ -51,9 +51,15 @@ ...@@ -51,9 +51,15 @@
# https://github.com/ansible/ansible-modules-core/pull/1031 # https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit - name: Waiting for bootstrap container to exit
command: docker wait bootstrap_nova command: docker wait bootstrap_nova
register: bootstrap_result
run_once: True run_once: True
when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed 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 - name: Cleaning up Nova bootstrap container
docker: docker:
name: bootstrap_nova name: bootstrap_nova
......
...@@ -48,8 +48,13 @@ ...@@ -48,8 +48,13 @@
- name: Waiting for bootstrap container - name: Waiting for bootstrap container
command: docker wait rabbitmq_bootstrap command: docker wait rabbitmq_bootstrap
register: bootstrap_result
when: exists.rc != 0 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 - name: Cleaning up bootstrap container
docker: docker:
image: "{{ rabbitmq_image_full }}" image: "{{ rabbitmq_image_full }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment