Skip to content

Commit

Permalink
Tagging - Add simple deprecations for purge_tags=False (ansible-colle…
Browse files Browse the repository at this point in the history
…ctions#1185)

Tagging - Add simple deprecations for purge_tags=False

Depends-On: ansible-collections#844
SUMMARY
Deprecate the use of purge_tags=False as a default
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_acm.py
plugins/modules/route53_health_check.py
plugins/modules/route53_zone.py
plugins/modules/sqs_queue.py
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@42688f3
  • Loading branch information
tremble authored and goneri committed Sep 21, 2022
1 parent 3a75fde commit 96f5c13
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
33 changes: 17 additions & 16 deletions plugins/modules/route53_health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,14 @@
- Will default to C(3) if not specified on creation.
choices: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
type: int
tags:
description:
- A hash/dictionary of tags to set on the health check.
type: dict
version_added: 2.1.0
purge_tags:
description:
- Delete any tags not specified in I(tags).
default: false
type: bool
version_added: 2.1.0
author: "zimbatm (@zimbatm)"
author:
- "zimbatm (@zimbatm)"
notes:
- Support for I(tags) and I(purge_tags) was added in release 2.1.0.
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.tags.deprecated_purge
'''

EXAMPLES = '''
Expand Down Expand Up @@ -432,8 +425,8 @@ def main():
string_match=dict(),
request_interval=dict(type='int', choices=[10, 30], default=30),
failure_threshold=dict(type='int', choices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
tags=dict(type='dict'),
purge_tags=dict(type='bool', default=False),
tags=dict(type='dict', aliases=['resource_tags']),
purge_tags=dict(type='bool'),
)

args_one_of = [
Expand All @@ -454,6 +447,14 @@ def main():
supports_check_mode=True,
)

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

state_in = module.params.get('state')
ip_addr_in = module.params.get('ip_address')
port_in = module.params.get('port')
Expand Down
35 changes: 17 additions & 18 deletions plugins/modules/route53_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,14 @@
- The reusable delegation set ID to be associated with the zone.
- Note that you can't associate a reusable delegation set with a private hosted zone.
type: str
tags:
description:
- A hash/dictionary of tags to add to the new instance or to add/remove from an existing one.
type: dict
version_added: 2.1.0
purge_tags:
description:
- Delete any tags not specified in the task that are on the zone.
This means you have to specify all the desired tags on each task affecting a zone.
default: false
type: bool
version_added: 2.1.0
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
author: "Christopher Troup (@minichate)"
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.tags.deprecated_purge
notes:
- Support for I(tags) and I(purge_tags) was added in release 2.1.0.
author:
- "Christopher Troup (@minichate)"
'''

EXAMPLES = r'''
Expand Down Expand Up @@ -445,8 +436,8 @@ def main():
comment=dict(default=''),
hosted_zone_id=dict(),
delegation_set_id=dict(),
tags=dict(type='dict'),
purge_tags=dict(type='bool', default=False),
tags=dict(type='dict', aliases=['resource_tags']),
purge_tags=dict(type='bool'),
)

mutually_exclusive = [
Expand All @@ -460,6 +451,14 @@ def main():
supports_check_mode=True,
)

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

zone_in = module.params.get('zone').lower()
state = module.params.get('state').lower()
vpc_id = module.params.get('vpc_id')
Expand Down

0 comments on commit 96f5c13

Please sign in to comment.