diff --git a/roles/deploy_container/defaults/main.yml b/roles/deploy_container/defaults/main.yml index d84b0d72..cee7ce12 100644 --- a/roles/deploy_container/defaults/main.yml +++ b/roles/deploy_container/defaults/main.yml @@ -42,7 +42,6 @@ deploy_container: service_autoscale_up_cooldown: 120 service_autoscale_down_cooldown: 120 service_autoscale_target_value: 70 # the value to trigger a scaling event at - service_elb_container_name: example # the name of the container to be load balanced execution_role_arn: "arn:aws:iam::000000000000:role/ecsTaskExecutionRole" # ARN of the IAM role to run the task as, must have access to the ECR repository if applicable containers: [] # list of container definitions, see docs: https://docs.ansible.com/ansible/latest/collections/community/aws/ecs_taskdefinition_module.html#parameter-containers #cpu: 512 # these values can be set globally or per container diff --git a/roles/deploy_container/tasks/main.yml b/roles/deploy_container/tasks/main.yml index dd64309f..17f339be 100644 --- a/roles/deploy_container/tasks/main.yml +++ b/roles/deploy_container/tasks/main.yml @@ -31,6 +31,10 @@ when: deploy_container.aws_ecr.enabled delegate_to: localhost +- name: Log out of Docker registry to force a login. + community.docker.docker_login: + state: absent + - name: Log into Docker registry. community.docker.docker_login: registry_url: "{{ deploy_container.docker_registry_url }}" @@ -275,7 +279,7 @@ launch_type: "{{ deploy_container.aws_ecs.launch_type }}" platform_version: LATEST load_balancers: # see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LoadBalancer.html - - containerName: "{{ deploy_container.aws_ecs.service_elb_container_name }}" + - containerName: "{{ deploy_container.container_name }}" containerPort: "{{ deploy_container.aws_ecs.target_group_port }}" targetGroupArn: "{{ _aws_ecs_target_group.target_group_arn }}" network_configuration: