Skip to content

Commit

Permalink
Update default value of purge_tags to True (ansible-collections#1343)
Browse files Browse the repository at this point in the history
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 <git@osuv.de>
Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@b56f3c6
tremble authored and abikouo committed Oct 26, 2023

Verified

This commit was signed with the committer’s verified signature.
ImgBotApp Imgbot
1 parent 03d14b5 commit 5d19069
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions plugins/modules/acm_certificate.py
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 5d19069

Please sign in to comment.