From f23fad23e7d3187d3b111220fad72e37ee08574d Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 2 Jun 2022 05:18:53 +0000 Subject: [PATCH] ecs_service and ecs_service_info: add name and service aliases (#1187) (#1192) [PR #1187/029333b3 backport][stable-2] ecs_service and ecs_service_info: add name and service aliases This is a backport of PR #1187 as merged into main (029333b). SUMMARY while ecs_service is using name for the service name parameter, ecs_service_info is using service for the same purpose. this PR adds just aliases to both modules, to use the same parameter to address the ecs service name. ref #1142 ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request COMPONENT NAME ecs_service ecs_service_info Reviewed-by: Markus Bergholz --- changelogs/fragments/0001-ecs-service-aliases.yml | 3 +++ plugins/modules/ecs_service.py | 3 ++- plugins/modules/ecs_service_info.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/0001-ecs-service-aliases.yml diff --git a/changelogs/fragments/0001-ecs-service-aliases.yml b/changelogs/fragments/0001-ecs-service-aliases.yml new file mode 100644 index 00000000000..1860536b600 --- /dev/null +++ b/changelogs/fragments/0001-ecs-service-aliases.yml @@ -0,0 +1,3 @@ +minor_changes: +- ecs_service - add ``service`` alias to address the ecs service name with the same parameter as the ecs_service_info module is doing (https://github.com/ansible-collections/community.aws/pull/1187). +- ecs_service_info - add ``name`` alias to address the ecs service name with the same parameter as the ecs_service module is doing (https://github.com/ansible-collections/community.aws/pull/1187). \ No newline at end of file diff --git a/plugins/modules/ecs_service.py b/plugins/modules/ecs_service.py index 16d0169527f..5c19280daaa 100644 --- a/plugins/modules/ecs_service.py +++ b/plugins/modules/ecs_service.py @@ -34,6 +34,7 @@ - The name of the service. required: true type: str + aliases: ['service'] cluster: description: - The name of the cluster in which the service exists. @@ -662,7 +663,7 @@ def health_check_setable(self, params): def main(): argument_spec = dict( state=dict(required=True, choices=['present', 'absent', 'deleting']), - name=dict(required=True, type='str'), + name=dict(required=True, type='str', aliases=['service']), cluster=dict(required=False, type='str'), task_definition=dict(required=False, type='str'), load_balancers=dict(required=False, default=[], type='list', elements='dict'), diff --git a/plugins/modules/ecs_service_info.py b/plugins/modules/ecs_service_info.py index 79332e55702..e2d867bebbb 100644 --- a/plugins/modules/ecs_service_info.py +++ b/plugins/modules/ecs_service_info.py @@ -42,6 +42,7 @@ required: false type: list elements: str + aliases: ['name'] extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -216,7 +217,7 @@ def main(): details=dict(type='bool', default=False), events=dict(type='bool', default=True), cluster=dict(), - service=dict(type='list', elements='str') + service=dict(type='list', elements='str', aliases=['name']) ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)