From f89c274b4abe2840c98db5ea105e6af29eb538b2 Mon Sep 17 00:00:00 2001 From: abikouo Date: Thu, 1 Feb 2024 12:24:42 +0100 Subject: [PATCH] delete additional key pairs --- .../roles/run_deploy_flask_app/tasks/delete.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/targets/test_deploy_flask_app/roles/run_deploy_flask_app/tasks/delete.yaml b/tests/integration/targets/test_deploy_flask_app/roles/run_deploy_flask_app/tasks/delete.yaml index cd99f8e0..73f1b384 100644 --- a/tests/integration/targets/test_deploy_flask_app/roles/run_deploy_flask_app/tasks/delete.yaml +++ b/tests/integration/targets/test_deploy_flask_app/roles/run_deploy_flask_app/tasks/delete.yaml @@ -44,8 +44,9 @@ # Delete EC2 key pair - name: Delete EC2 key pair amazon.aws.ec2_key: - name: "{{ deploy_flask_app_sshkey_pair_name }}" + name: "{{ item }}" state: absent + with_items: "{{ ec2_instances.instances | map(attribute='key_name') | unique | list }}" # Delete RDS information - name: Delete RDS instance