diff --git a/changelogs/fragments/s3_bucket_fix_non_str_tags.yaml b/changelogs/fragments/s3_bucket_fix_non_str_tags.yaml new file mode 100644 index 00000000000..7a6e0e9f657 --- /dev/null +++ b/changelogs/fragments/s3_bucket_fix_non_str_tags.yaml @@ -0,0 +1,5 @@ +--- +bugfixes: + - s3_bucket - Prior to 2.6 using non-text tags worked, although was not idempotent. In 2.6 + waiters were introduced causing non-text tags to be fatal to the module's completion. + This fixes the module failure as well as idempotence using integers as tags. diff --git a/lib/ansible/modules/cloud/amazon/s3_bucket.py b/lib/ansible/modules/cloud/amazon/s3_bucket.py index e170d8538d9..4ff462d2035 100644 --- a/lib/ansible/modules/cloud/amazon/s3_bucket.py +++ b/lib/ansible/modules/cloud/amazon/s3_bucket.py @@ -230,6 +230,8 @@ def create_or_update_bucket(s3_client, module, location): module.fail_json_aws(e, msg="Failed to get bucket tags") if tags is not None: + # Tags are always returned as text + tags = dict((to_text(k), to_text(v)) for k, v in tags.items()) if current_tags_dict != tags: if tags: try: