Skip to content

Commit

Permalink
Minor fixups (ansible-collections#1328)
Browse files Browse the repository at this point in the history
ecs_service - Minor fixups

SUMMARY

Bad rebase resulted in a duplicated parameter
Fixup "changed" after adding initial support for tags

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ecs_service
ADDITIONAL INFORMATION
Bugs aren't in a released version yet, no need for changelog

Reviewed-by: Joseph Torcasso <None>
  • Loading branch information
tremble authored and markuman committed Aug 4, 2022
1 parent c7720d7 commit ddfb738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions plugins/modules/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/targets/ecs_cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ddfb738

Please sign in to comment.