Is that possible to retrieve latest image uri from ECR using ansible module? if yes, please guide with the module name.
Yes, that’s possible.
- name: get service info
community.aws.ecs_service_info:
cluster: "{{ CLUSTER }}"
service: "{{ SERVICE }}"
details: true
register: service
- name: get taskdefinition info
community.aws.ecs_taskdefinition_info:
task_definition: "{{ service.services[0].taskDefinition }}"
register: td
- name: do something usefull with the image in use
debug:
var: td.container_definitions[0].image