Skip to content

Commit

Permalink
ec2_instance - Fix check_mode behaviour with tags (ansible-collection…
Browse files Browse the repository at this point in the history
…s#189)

* Add test for changing tags in check_mode

* ec2_instance: Fix check_mode behaviour with tags

* Add changelog fragment
  • Loading branch information
tremble authored Aug 28, 2020
1 parent ca9b760 commit b06e760
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
Expand Down

0 comments on commit b06e760

Please sign in to comment.