Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 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
4 changes: 4 additions & 0 deletions changelogs/fragments/0000-ecs_taskdefinition_fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bugfixes:
- ecs_taskdefinition - fix broken change detect of ``launch_type`` parameter (https://github.com/ansible-collections/community.aws/pull/1145).
- ecs_service - fix broken compare of ``task_definition`` that results always in a changed task (https://github.com/ansible-collections/community.aws/pull/1145).
- ecs_service - add missing change detect of ``health_check_grace_period_seconds`` parameter (https://github.com/ansible-collections/community.aws/pull/1145).
9 changes: 8 additions & 1 deletion plugins/modules/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,14 @@ def describe_service(self, cluster_name, service_name):
raise Exception("Unknown problem describing service %s." % service_name)

def is_matching_service(self, expected, existing):
if expected['task_definition'] != existing['taskDefinition']:
# aws returns the arn of the task definition
# arn:aws:ecs:eu-central-1:123456789:task-definition/ansible-fargate-nginx:3
# but the user is just entering
# ansible-fargate-nginx:3
if expected['task_definition'] != existing['taskDefinition'].split('/')[-1]:
return False

if expected.get('health_check_grace_period_seconds') != existing.get('healthCheckGracePeriodSeconds'):
return False

if (expected['load_balancers'] or []) != existing['loadBalancers']:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ecs_taskdefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def _task_definition_matches(requested_volumes, requested_containers, requested_
if requested_task_role_arn != td.get('taskRoleArn', ""):
return None

if requested_launch_type is not None and requested_launch_type not in td.get('compatibilities', []):
if requested_launch_type is not None and requested_launch_type not in td.get('requiresCompatibilities', []):
return None

existing_volumes = td.get('volumes', []) or []
Expand Down
Loading