From 5d19069855767dcedab0928e677775f4e8efb877 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Mon, 11 Jul 2022 14:42:21 +0200 Subject: [PATCH] Update default value of purge_tags to True (#1343) Update default value of purge_tags to True SUMMARY Complete the deprecation cycle and update purge_tags default value to True ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/modules/acm_certificate.py plugins/modules/cloudfront_distribution.py plugins/modules/ec2_vpc_vpn.py plugins/modules/kms_key.py plugins/modules/rds_param_group.py plugins/modules/route53_health_check.py plugins/modules/route53_zone.py plugins/modules/sqs_queue.py ADDITIONAL INFORMATION Reviewed-by: Markus Bergholz Reviewed-by: Alina Buzachis This commit was initially merged in https://github.com/ansible-collections/community.aws See: https://github.com/ansible-collections/community.aws/commit/b56f3c6302db8ebb076fcf83eedc5b73aca31f8f --- plugins/modules/acm_certificate.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/plugins/modules/acm_certificate.py b/plugins/modules/acm_certificate.py index 6b48579d5bc..8264404be7e 100644 --- a/plugins/modules/acm_certificate.py +++ b/plugins/modules/acm_certificate.py @@ -177,7 +177,7 @@ extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 - - amazon.aws.tags.deprecated_purge + - amazon.aws.tags ''' EXAMPLES = ''' @@ -495,7 +495,7 @@ def main(): name_tag=dict(aliases=['name']), private_key=dict(no_log=True), tags=dict(type='dict', aliases=['resource_tags']), - purge_tags=dict(type='bool'), + purge_tags=dict(type='bool', default=True), state=dict(default='present', choices=['present', 'absent']), ) module = AnsibleAWSModule( @@ -504,14 +504,6 @@ def main(): ) acm = ACMServiceManager(module) - if module.params.get('purge_tags') is None: - module.deprecate( - 'The purge_tags parameter currently defaults to False.' - ' For consistency across the collection, this default value' - ' will change to True in release 5.0.0.', - version='5.0.0', collection_name='community.aws') - module.params['purge_tags'] = False - # Check argument requirements if module.params['state'] == 'present': # at least one of these should be specified. @@ -532,6 +524,9 @@ def main(): desired_tags = None if module.params.get('tags') is not None: desired_tags = module.params['tags'] + else: + # Because we're setting the Name tag, we need to explicitly not purge when tags isn't passed + module.params['purge_tags'] = False if module.params.get('name_tag') is not None: # The module was originally implemented to filter certificates based on the 'Name' tag. # Other tags are not used to filter certificates.