copr: aws terminator: ignore errors

Sometimes we delete the worker in AWS web UI, and our termination script
should ignore the error (at least for now, less error prone solution is
needed).

I suppose that copr backend code should survive the playbook failures,
but it doesn't yet: https://pagure.io/copr/copr/issue/1112
This commit is contained in:
Pavel Raiskup 2019-11-20 15:55:21 +01:00 committed by Pierre-Yves Chibon
parent 22d53e218c
commit c92658c392

View file

@ -14,12 +14,14 @@
state: running
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
register: ec2
ignore_errors: yes
register: ec2_list_result
- local_action:
module: ec2
region: "{{ aws_region }}"
state: absent
instance_ids: "{{ ec2.instance_ids }}"
instance_ids: "{{ ec2_list_result.instance_ids }}"
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
when: not ec2_list_result.failed