From c92658c3929750ac5d4a5415bb1e65bbf06c0dc8 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 20 Nov 2019 15:55:21 +0100 Subject: [PATCH] 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 --- roles/copr/backend/files/provision/terminatepb-aws.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/files/provision/terminatepb-aws.yml b/roles/copr/backend/files/provision/terminatepb-aws.yml index 69c63ca70f..d711fbfe8c 100644 --- a/roles/copr/backend/files/provision/terminatepb-aws.yml +++ b/roles/copr/backend/files/provision/terminatepb-aws.yml @@ -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