- name: Prepare images
  hosts: all
  strategy: mitogen_free
  gather_facts: true
  tasks:
    - name: Commit containers
      command: >
        docker commit
        --change 'EXPOSE 22'
        --change 'CMD ["/usr/sbin/sshd", "-D"]'
        {{ inventory_hostname }}
        public.ecr.aws/n5z0e8q9/{{ inventory_hostname }}-test
      delegate_to: localhost

    - name: Stop containers
      command: >
        docker rm -f {{ inventory_hostname }}
      delegate_to: localhost
