Commit c4493217 by John Jarvis

only terminate if the instance count is one

parent b26235a2
......@@ -8,12 +8,13 @@
tags:
Name: "{{ name_tag }}"
register: tag_lookup
- fail: 'Too many results returned, not terminating!'
- debug: msg="Too many results returned, not terminating!"
when: tag_lookup.instance_ids|length > 1
- ec2:
state: 'absent'
region: "{{ region }}"
instance_ids: ${tag_lookup.instance_ids}
when: tag_lookup.instance_ids|length == 1
roles:
- role: launch_ec2
keypair: "{{ keypair }}"
......
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