Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs_tag/efs_tag - add resource_tags as alias for tags #1184

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/1184-tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- ecs_tag - ``resource_tags`` has been added as an alias for the ``tags`` parameter (https://github.com/ansible-collections/community.aws/pull/1184).
- efs_tag - ``resource_tags`` has been added as an alias for the ``tags`` parameter (https://github.com/ansible-collections/community.aws/pull/1184).
3 changes: 2 additions & 1 deletion plugins/modules/ecs_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- A dictionary of tags to add or remove from the resource.
- If the value provided for a tag is null and I(state=absent), the tag will be removed regardless of its current value.
type: dict
aliases: ['resource_tags']
purge_tags:
description:
- Whether unspecified tags should be removed from the resource.
Expand Down Expand Up @@ -155,7 +156,7 @@ def main():
argument_spec = dict(
cluster_name=dict(required=True),
resource=dict(required=False),
tags=dict(type='dict'),
tags=dict(type='dict', aliases=['resource_tags']),
purge_tags=dict(type='bool', default=False),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

state=dict(default='present', choices=['present', 'absent']),
resource_type=dict(default='cluster', choices=['cluster', 'task', 'service', 'task_definition', 'container'])
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/efs_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- If the value provided for a tag is null and I(state=absent), the tag will be removed regardless of its current value.
type: dict
required: True
aliases: ['resource_tags']
purge_tags:
description:
- Whether unspecified tags should be removed from the resource.
Expand Down Expand Up @@ -124,7 +125,7 @@ def main():
'''
argument_spec = dict(
resource=dict(required=True),
tags=dict(type='dict', required=True),
tags=dict(type='dict', required=True, aliases=['resource_tags']),
purge_tags=dict(type='bool', default=False),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tremble Should't we uniform the default behaviour of purge_tags by defaulting to true even here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure. I wanted to get the "easy" bits in first, and was going to follow up with that later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the aliases was also something I can backport safely

state=dict(default='present', choices=['present', 'absent'])
)
Expand Down