summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorLénaïc Huard <lhuard@amadeus.com>2016-02-23 18:17:08 +0100
committerLénaïc Huard <lhuard@amadeus.com>2016-02-23 18:17:08 +0100
commit1d832a01362e0cbf97c8f3ff660fa4ef8b3c8426 (patch)
tree962e06af878ca659030a318e42c2d0325d90e3d1 /playbooks
parentdc8938e01202db0464e54becf4812c3191ce2d51 (diff)
downloadopenshift-1d832a01362e0cbf97c8f3ff660fa4ef8b3c8426.tar.gz
openshift-1d832a01362e0cbf97c8f3ff660fa4ef8b3c8426.tar.bz2
openshift-1d832a01362e0cbf97c8f3ff660fa4ef8b3c8426.tar.xz
openshift-1d832a01362e0cbf97c8f3ff660fa4ef8b3c8426.zip
Better diagnostic messages when an OpenStack heat stack creation fails
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/openstack/openshift-cluster/launch.yml37
1 files changed, 35 insertions, 2 deletions
diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml
index e9b9cf540..0afcad72e 100644
--- a/playbooks/openstack/openshift-cluster/launch.yml
+++ b/playbooks/openstack/openshift-cluster/launch.yml
@@ -29,7 +29,7 @@
- name: Create or Update OpenStack Stack
command: 'heat {{ heat_stack_action }} -f {{ openstack_infra_heat_stack }}
- --timeout 3 --enable-rollback
+ --timeout 3
-P cluster_env={{ cluster_env }}
-P cluster_id={{ cluster_id }}
-P subnet_24_prefix={{ openstack_subnet_24_prefix }}
@@ -59,7 +59,40 @@
until: stack_show_status_result.stdout not in ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS']
retries: 30
delay: 5
- failed_when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
+
+ - name: Display the stack resources
+ command: 'heat resource-list openshift-ansible-{{ cluster_id }}-stack'
+ register: stack_resource_list_result
+ when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
+
+ - name: Display the stack status
+ command: 'heat stack-show openshift-ansible-{{ cluster_id }}-stack'
+ register: stack_show_result
+ when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
+
+ - name: Delete the stack
+ command: 'heat stack-delete openshift-ansible-{{ cluster_id }}-stack'
+ when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
+
+ - fail:
+ msg: |
+
+ +--------------------------------------+
+ | ^ |
+ | /!\ Failed to create the heat stack |
+ | /___\ |
+ +--------------------------------------+
+
+ Here is the list of stack resources and their status:
+ {{ stack_resource_list_result.stdout }}
+
+ Here is the status of the stack:
+ {{ stack_show_result.stdout }}
+
+ ^ Failed to create the heat stack
+ /!\
+ /___\ Please check the `stack_status_reason` line in the above array to know why.
+ when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
- name: Read OpenStack Stack outputs
command: 'heat stack-show openshift-ansible-{{ cluster_id }}-stack'