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:
parent
22d53e218c
commit
c92658c392
1 changed files with 4 additions and 2 deletions
|
@ -14,12 +14,14 @@
|
||||||
state: running
|
state: running
|
||||||
aws_access_key: "{{ aws_access_key }}"
|
aws_access_key: "{{ aws_access_key }}"
|
||||||
aws_secret_key: "{{ aws_secret_key }}"
|
aws_secret_key: "{{ aws_secret_key }}"
|
||||||
register: ec2
|
ignore_errors: yes
|
||||||
|
register: ec2_list_result
|
||||||
|
|
||||||
- local_action:
|
- local_action:
|
||||||
module: ec2
|
module: ec2
|
||||||
region: "{{ aws_region }}"
|
region: "{{ aws_region }}"
|
||||||
state: absent
|
state: absent
|
||||||
instance_ids: "{{ ec2.instance_ids }}"
|
instance_ids: "{{ ec2_list_result.instance_ids }}"
|
||||||
aws_access_key: "{{ aws_access_key }}"
|
aws_access_key: "{{ aws_access_key }}"
|
||||||
aws_secret_key: "{{ aws_secret_key }}"
|
aws_secret_key: "{{ aws_secret_key }}"
|
||||||
|
when: not ec2_list_result.failed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue