From 7a112864c6e2f51c4a9e65fcb2122891c0c5c712 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 21 Aug 2025 21:25:32 +0200 Subject: [PATCH] chore(ansible): add notice about possible ec2_instance module issue --- snippets/ansible/tasks.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/ansible/tasks.yml b/snippets/ansible/tasks.yml index c9731a0..d0b0e92 100644 --- a/snippets/ansible/tasks.yml +++ b/snippets/ansible/tasks.yml @@ -627,6 +627,11 @@ ansible.builtin.pause: seconds: 60 - name: EC2-specific operations + # Notice: tasks using the 'ec2_instance' module might create a new instance even if older ones exist from a + # different run, but return the *old* instance's ID and information. + # This seems to be an issue with how the module filters EC2 instances out when deciding whether existing + # instances match and should be altered. By default, instances are filtered by 'Name' tag, base AMI, state, and + # subnet ID. Refer the module's 'filters' property. block: - name: Get running instances with 'K8S' as the 'Application' tag amazon.aws.ec2_instance_info: