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