Upgrading to GitLab 12.0.2.

Fix demo server reset being an unrecoverable error

- Add conditional checks to prevent the script from failing with errors if the
  demo instance is shutdown or terminated.
- Cleanup: Terminate the demo instance if shut down. A new server will be spun
  up in the next reset cycle.

Fixes #10Signed-off-by: Joseph Nuthalapati's avatarJoseph Nuthalapati <njoseph@thoughtworks.com>
parent d4038bb1
......@@ -37,8 +37,10 @@
- name: Bind the demo server's instance_id to a variable
demo_instance_id: "{{ current_demo_instances.instances[0].instance_id }}"
when: current_demo_instances['instances'][0] is defined
- debug: var=demo_instance_id
when: demo_instance_id is defined
- name: Launch a new demo instance from the demo-server AMI
......@@ -52,6 +54,7 @@
Name: demo-instance
State: replacement
instance_initiated_shutdown_behavior: terminate
- name: Get instance_id of the replacement demo server
......@@ -91,3 +94,4 @@
state: absent
wait: yes
instance_id: "{{ demo_instance_id }}"
when: demo_instance_id is defined
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment