diff --git a/plugins/modules/ecs_service.py b/plugins/modules/ecs_service.py index 800d670be21..95fa43b52b4 100644 --- a/plugins/modules/ecs_service.py +++ b/plugins/modules/ecs_service.py @@ -730,7 +730,7 @@ def is_matching_service(self, expected, existing): # but the user is just entering # ansible-fargate-nginx:3 if expected['task_definition'] != existing['taskDefinition'].split('/')[-1]: - if existing['deploymentController']['type'] != 'CODE_DEPLOY': + if existing.get('deploymentController', {}).get('type', None) != 'CODE_DEPLOY': return False if expected.get('health_check_grace_period_seconds'): @@ -740,10 +740,10 @@ def is_matching_service(self, expected, existing): if (expected['load_balancers'] or []) != existing['loadBalancers']: return False - if expected['propagate_tags'] != existing['propagateTags']: + if (expected['propagate_tags'] or "NONE") != existing['propagateTags']: return False - if boto3_tag_list_to_ansible_dict(existing['tags']) != expected['tags']: + if boto3_tag_list_to_ansible_dict(existing.get('tags', [])) != (expected['tags'] or {}): return False # expected is params. DAEMON scheduling strategy returns desired count equal to @@ -1049,7 +1049,6 @@ def main(): network_configuration, serviceRegistries, module.params['launch_type'], - module.params['scheduling_strategy'], module.params['platform_version'], module.params['scheduling_strategy'], capacityProviders, diff --git a/tests/integration/targets/ecs_cluster/tasks/main.yml b/tests/integration/targets/ecs_cluster/tasks/main.yml index 6a6ca91d00f..57a010a5bdb 100644 --- a/tests/integration/targets/ecs_cluster/tasks/main.yml +++ b/tests/integration/targets/ecs_cluster/tasks/main.yml @@ -234,7 +234,7 @@ assert: that: - "ecs_service.service.placementConstraints[0].type == 'distinctInstance'" - + - name: check that ECS service was created with deployment_circuit_breaker assert: that: @@ -329,6 +329,7 @@ containerName: "{{ ecs_task_name }}" containerPort: "{{ ecs_task_container_port }}" role: "ecsServiceRole" + wait: true register: ecs_service_scale_down - name: assert that ECS service is scaled down