--- - hosts: 127.0.0.1 connection: local gather_facts: false vars: fedora_versions: - 29 - 31 - 33 registry_url: 'registry.fedoraproject.org' toolbox_image: 'fedora-toolbox' toolbox_dirs: [] registry_urls: [] pre_tasks: - set_fact: toolbox_dirs: "{{ toolbox_dirs }} + [ '{{ toolbox_image }}-{{ item }}' ]" registry_urls: "{{ registry_urls }} + [ '{{ registry_url }}/f{{ item }}/{{ toolbox_image }}:{{item }}' ]" loop: "{{ fedora_versions }}" tasks: - name: Ensure a directory exist to store the toolbox images debug: msg: 'mkdir ./{{ item }}' loop: "{{ toolbox_dirs }}" - name: Ensure the toolbox image is at local directory debug: msg: "skopeo copy docker://{{ item.0 }} dir:{{ item.1 }}" loop: "{{ registry_urls|zip(toolbox_dirs)|list }}"