I am trying to reduce the amount of tasks we have to repeat for some of our playbooks when publishing versions of services to our repository. What I want to do is publish the latest version "latest" and the version of it which we use set_fact for and loop through all the services we define.
Example of current:
- name: Push Helm Template to ACR
command: helm chart push {{ docker_registry }}/helm/{{ service_name }}:{{ item }}
loop:
- latest
- "{{ version }}"
What I want to do is have it publish all latest versions of
- service1
- service2
- service3
etc
and in the same task, publish the {{ version }} of that service using the same loop. Is this possible to do in one task or is it better to just separate out the tasks?