From b06e760259418f8462c3b30c5a312e3740fda4c8 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 28 Aug 2020 02:12:41 +0200 Subject: [PATCH] ec2_instance - Fix check_mode behaviour with tags (#189) * Add test for changing tags in check_mode * ec2_instance: Fix check_mode behaviour with tags * Add changelog fragment --- ec2_instance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ec2_instance.py b/ec2_instance.py index ddedd379573..e87f64cdf29 100644 --- a/ec2_instance.py +++ b/ec2_instance.py @@ -894,6 +894,8 @@ def manage_tags(match, new_tags, purge_tags, ec2): old_tags, new_tags, purge_tags=purge_tags, ) + if module.check_mode: + return bool(tags_to_delete or tags_to_set) if tags_to_set: ec2.create_tags( Resources=[match['InstanceId']],